home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume89 / comm / vt100r29.2 < prev    next >
Internet Message Format  |  1989-10-20  |  79KB

  1. Path: xanth!ames!sun-barr!newstop!sun!swap!page
  2. From: page%swap@Sun.COM (Bob Page)
  3. Newsgroups: comp.sources.amiga
  4. Subject: v89i179:  vt100 - terminal emulator v2.9, Part02/09
  5. Message-ID: <126576@sun.Eng.Sun.COM>
  6. Date: 20 Oct 89 06:09:10 GMT
  7. Sender: news@sun.Eng.Sun.COM
  8. Lines: 2275
  9. Approved: page@sun.com
  10.  
  11. Submitted-by: acs@pccuts.pcc.amdahl.com (Tony Sumrall)
  12. Posting-number: Volume 89, Issue 179
  13. Archive-name: comm/vt100r29.2
  14.  
  15. # This is a shell archive.
  16. # Remove anything above and including the cut line.
  17. # Then run the rest of the file through 'sh'.
  18. # Unpacked files will be owned by you and have default permissions.
  19. #----cut here-----cut here-----cut here-----cut here----#
  20. #!/bin/sh
  21. # shar: SHell ARchive
  22. # Run the following text through 'sh' to create:
  23. #    README
  24. #    ReleaseNotes
  25. #    RexxSamples/Forward.rexx
  26. #    RexxSamples/Forwarding.rexx
  27. #    RexxSamples/FwdLogon.vt100
  28. #    RexxSamples/OnLogon.vt100
  29. #    RexxSamples/TestDisplay.vt100
  30. #    RexxSamples/TestErrs.vt100
  31. #    RexxSamples/TestFor.rexx
  32. #    RexxSamples/TestMsg.vt100
  33. #    Zmodem/README.1ST
  34. #    Zmodem/Amiga.doc
  35. #    Zmodem/sz.doc
  36. #    Zmodem/rz.doc
  37. #    Zmodem/makefile.ami
  38. #    Zmodem/makefile.uni
  39. #    Zmodem/zmodem.init
  40. #    Zmodem/zmodem.h
  41. # This is archive 2 of a 9-part kit.
  42. # This archive created: Thu Oct 19 22:30:28 1989
  43. echo "extracting README"
  44. sed 's/^X//' << \SHAR_EOF > README
  45. XThis archive contains a vt100 emulator with KERMIT and XMODEM file
  46. Xtransfer protocols.  Original work by Dave Wecker, V2.7-V2.8 by Tony Sumrall.
  47. X
  48. XThanks:
  49. X-------
  50. X    To everyone who sent in code, suggestions and fixes!
  51. X
  52. XReleases:
  53. X---------
  54. X    v2.9 ?????? ACS - See Release Notes.
  55. X    v2.8 880117 ACS - See Release Notes.
  56. X    v2.7 870825 ACS - See Release Notes.
  57. X    v2.6 870227 DBW - bug fixes for all the stuff in v2.5
  58. X    v2.5 870214 DBW - more additions (see readme file)
  59. X    v2.4 861214 DBW - lots of fixes/additions
  60. X    v2.3 861101 DBW - minor bug fixes
  61. X    v2.2 861012 DBW - more of the same
  62. X    v2.1 860915 DBW - new features (see README)
  63. X    v2.0 860823 DBW - Major rewrite
  64. X    v1.1 860720 DBW    - Switches, 80 cols, colors, bug fixes
  65. X    v1.0 860712 DBW    - First version released
  66. X
  67. XUsage:
  68. X------
  69. X    Please read VT100.DOC for usage information and examples.
  70. X
  71. XKnown problems:
  72. X---------------
  73. X    none
  74. X
  75. XSuggestions/bug fixes not implemented (as of yet):
  76. X--------------------------------------------------
  77. X    - Custom screen should use a borderless backdrop window
  78. X    - Quit from keyboard should be supported (for above)
  79. X    - Automatic maximum sizing of window should happen
  80. X    - Screen should be resizable
  81. X    - AT TIME should be implemented in scripts (besides DELAY)
  82. X    - Kermit should create sub directories (when necessary)
  83. X    - Use a disk font for graphic character set
  84. X    - Kermit VM/CMS (IBM) protocol support (it works for me, how about
  85. X      you?)
  86. X    - Allow the user to use a keymap different from the default one.
  87. X
  88. XInstallation:
  89. X-------------
  90. X    The files in this archive may be extracted by the bourne shell
  91. X    (/bin/sh) or the shar program using the "unshar switch (-u)",
  92. X    contact me if you need a copy of this version of shar.
  93. X
  94. X    REMEMBER: Set the correct compiler definition in VT100.H
  95. X
  96. XFiles:
  97. X------
  98. X    README        - this file
  99. X    ReleaseNotes    - Details of what's changed
  100. X    vt100.doc    - documentation for the terminal emulator
  101. X    makefile    - make file for the emulator (under MANX AZTEC-C)
  102. X    vt100.h        - include file used by all other modules
  103. X    window.c    - manager for window and keyboard
  104. X    vt100.c        - main module, handles menus
  105. X    remote.c    - handle remote characters (vt100 emulation)
  106. X    kermit.c    - kermit protocol (to transfer text files on VMS
  107. X              select the CRLF option on the transfer mode menu,
  108. X              otherwise use image mode).
  109. X    init.c        - startup code
  110. X    xmodem.c    - xmodem protocol that understands AMIGA binary and
  111. X              text file formats (automatically).
  112. X    script.c    - script control package
  113. X    expand.c    - filename expansion (wildcards) and dir setting
  114. X    rexx.c        - handles the AREXX interface
  115. X    newkermit.c    - New kermit module by Steve Walton suitable for
  116. X              expanding VT100's capabilities
  117. X    kermitproto.c    - New kermit module by Steve Walton
  118. X    kermitproto.h    - New kermit module by Steve Walton
  119. X
  120. XOther directories:
  121. X
  122. XRexxSamples:
  123. X    Forward.rexx    - Shows use of FORWARD command.  Interacts with VT100.
  124. X    Forwarding.rexx    - Shows use of FORWARD command.  Interacts with VT100.
  125. X    TestFor.rexx    - Shows use of FORWARD command.  Interacts with VT100.
  126. X    FwdLogon.vt100    - Demos use of FORWARD cmd to log you on
  127. X    OnLogon.vt100    - Demos use of ON and FORWARD cmds to log you on
  128. X    TestMsg.vt100    - Demos use of MSG command.
  129. X    TestDisp.vt100    - Demos use of DISPLAY command.
  130. X    TestErrs.vt100    - Shows various return codes from VT100 commands.
  131. X
  132. XZmodem:
  133. X    Amiga.doc    - Text file about the Amiga implementation of zmodem
  134. X    SerIO.c        - Serial I/O support for Zmodem
  135. X    makefile.ami    - Amiga makefile for Zmodem
  136. X    makefile.uni    - Un*x makefile for Zmodem
  137. X    patch        - Patches that I applied to the Frank's original
  138. X    rbsb.c        - Support routines for Zmodem
  139. X    rz.c        - Mainline code for Zmodem receive
  140. X    rz.doc        - Documentation for Amiga Zmodem receive
  141. X    sz.c        - Mainline code for Zmodem send
  142. X    sz.doc        - Documentation for Amiga Zmodem send
  143. X    term.c        - Terminal-mode routine for Amiga Zmodem
  144. X    zm.c        - Support routines for Zmodem
  145. X    zmodem.h    - Header file for Amiga Zmodem
  146. X    zmodem.init    - Sample Amiga Zmodem initialization file
  147. X
  148. XGNU-Emacs:
  149. X    amiga.el    - Emacs Lisp code to utilitize the mouse.
  150. X
  151. X
  152. XContact:
  153. X--------
  154. XPlease send bugs/comments/suggestions/praise for V2.9 to:
  155. X
  156. X    Tony Sumrall at USENET: acs@amdahl.com
  157. SHAR_EOF
  158. echo "extracting ReleaseNotes"
  159. sed 's/^X//' << \SHAR_EOF > ReleaseNotes
  160. XRelease Notes:
  161. X--------------
  162. Xv2.9 ?????? ACS - Many changes.  Highlights:
  163. X    - Open information window at far right of main window.
  164. X    - Remember last CD name, last script file name and the name of the last
  165. X      file transferred.
  166. X    - Support mouse location presentation including new MENU options in the
  167. X      Utility menu (Mouse Up and Mouse Dn), new F-key command "F M" to
  168. X      set the mouse introducer and some ELISP code to allow GNU EMACS to
  169. X      make use of the mouse.  Compliments of: Mike (I'll think of something
  170. X      yet) Meyer <mwm@violet.berkeley.edu> and Mic Kaczmarczik
  171. X      (mic@emx.cc.utexas.edu).
  172. X    - Correctly handles multiple menu selections at once.
  173. X    - New command: AUTOCHOP (with companion shortcut) to enable/disable
  174. X      XMODEM auto-chop code.
  175. X    - New command: RX which will invoke an AREXX macro (if compiled with
  176. X      AREXX defined AND you have AREXX).  Companion shortcut.  Unrecognized
  177. X      commands are automatically sent to AREXX.
  178. X    - XMODEM now uses a larger buffer (4K) so it won't write to disk so
  179. X      often.
  180. X    - New command: EXTERNAL which allows specification of an external (to
  181. X      VT100) program which is to handle file transfer.  XPROTO command can
  182. X      select an EXTERNAL protocol as the default.  Note that this is NOT
  183. X      support or external protocol libraries -- that will come in a later
  184. X      release.  Along with this I'm, distributing a modified version of
  185. X      Frank Anthes' sz/rz port to the Amiga.
  186. X    - Added a RexxSamples directory to the distribution.
  187. X    - A500/A2000 users can use ()*/ on their keypad as F1-F4.
  188. X    - New command: FONTSIZE.  User may now specify the size of the font to
  189. X      be used...you're no longer restricted to 8x8.  Still doesn't handle
  190. X      proportional fonts.
  191. X    - New, optional, kermit routines: kermitproto.[ch] and newkermit.c
  192. X      courtesy of Steve Walton.  You may use these routines in place of
  193. X      the original kermit.c
  194. X    - Should compile under Lattice 5.02 with few error messages.  REMEMBER
  195. X      TO CHANGE THE DEFINE IN VT100.H!!!
  196. X    - New command: MSG allows user to display text in the info window.
  197. Xv2.8 880117 ACS - Info/Status window automatically deselected.
  198. X    - 1st menu item re-worked.  Now the user need only choose Send,
  199. X      Receive, Kermit Get, Kermit Bye and Capture.  Protocol to send or
  200. X      receive is selected via the 1st sub-menu from the 1st menu item.
  201. X    - New command: XPROTO XMODEM | XMODEMCRC | ASCII | KERMIT to select
  202. X      transfer protocol via scripts.
  203. X    - User may capture simultaneously with sending or receiving via
  204. X      a different protocol by using the Capture menu item.  This item
  205. X      changes to Capturing when capture is in effect.
  206. X    - Kermit will transfer long packets (up to 1000 bytes).  New cmd:
  207. X      "KMAXPACK n" sets maximum packet length to n bytes.  Remember to
  208. X      increase your send and/or receive timeouts on your host!!!
  209. X    - Added insert/delete character to the recognized escape sequences.
  210. X      ESC [ n @ inserts n characters, ESC [ n P deletes n characters
  211. X      (thanks to John Wang (jwang@ATRP.MEDIA.MIT.EDU)).  He suggests 
  212. X      using the following termcap:
  213. X      CA|vt100|amiga|Amiga termcap:al=\E[L:AL=\E[%dL:am:bl=^G:bs:cd=\E[J:\
  214. X        :ce=\E[K:cl=\E[;H\E[2J:cm=\E[%i%d;%dH:co#80:cr=^M:cs=\E[%i%d;%dr:\
  215. X        :dc=\E[P:DC=\E[%dP:dl=\E[M:DL=\E[%dM:do=^J:ho=\E[H:\
  216. X        :is=\E[1;24r\E[24;1H:ic=\E[@:IC=\E[%d@:kb=^H:kd=\E[B:\
  217. X        :ke=\E[?1l\E>:kl=\E[D:kr=\E[C:ks=\E[?1h\E=:ku=\E[A:k1=\EOP:\
  218. X        :k2=\EOQ:k3=\EOR:k4=\EOS:le=^H:li#24:mb=\E[5m:md=\E[1m:me=\E[m:\
  219. X        :mr=\E[7m:nd=\E[C:pt:rc=\E8:rf=/usr/lib/tabset/vt100:\
  220. X        :rs=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:sc=\E7:se=\E[m:\
  221. X        :sf=^J:so=\E[7m:sr=\EM:ta=^I:ue=\E[m:up=\E[A:us=\E[4m:vc#16:vt#3:xn:
  222. X    - Fixed scroll regions.  Now will not wrap-around out of a scroll
  223. X      region. (thanks to Tad Guy (ames!xanth.cs.odu.edu!tadguy))
  224. X    - Fixed the FileLock() problem (thanks to many!).
  225. X    - The "nagging requester" bug was a bug in *my* code (gasp!).  Thanks
  226. X      to Joel Swank (joels@tekred.TEK.COM) for finding and squashing it!
  227. X    - Fixed overzealous xmodem chopping.  It now strips contiguous
  228. X      strings of nulls OR Ctrl-Z (not a mixture) and will avoid writing
  229. X      anything if they were all chopped.  Thanks to Wayne Davison
  230. X      (drivax!davison--I only had to modify it a little, Wayne).  Also,
  231. X      when sending, it now sends a stream of nulls OR Ctrl-Zs, whichever
  232. X      is NOT the last character.
  233. X    - Removed an extraneous continue in readchar().  Thanks to someone!
  234. X      (Sorry, I lost your name and address.)
  235. X    - Now uses the default keymap.  All of the old mappings have been
  236. X      retained (e.g. Ctrl-2 generates Ctrl-@, Ctrl-6 generates Ctrl-^,
  237. X      ALT acts as META key (i.e. sets the high-order bit)).  Note,
  238. X      however, that your keymap may preclude the use of the ALT key if
  239. X      dead keys are defined.  A future version will support specification
  240. X      of a keymap different from the system map.
  241. X    - New commands: SENDF file-spec and REC file which will send/receive
  242. X      via the default XPROTO setting.  You still have XS, KR, etc.
  243. X    - New command: FONT font-name.  Allows the user to specify which
  244. X      8-point font to use.  If you want to use your new whippy-font, sau
  245. X      FONT whippy-font.  These must be 8-point fonts for now!
  246. X    - Saying LINES 0 will use all available lines on the screen (useful
  247. X      to you MoreRows groupies).
  248. X    - P_unit may be changed in vt100.c to specify a different unit of
  249. X      the serial.device to use (for expansion serial ports).  As of this
  250. X      writing there are no expansion serial devices...this is just in
  251. X      preparation for the future.  Also provided a new INIT command:
  252. X      UNIT which accomplishes the same result.
  253. Xv2.7 870825 ACS - Requester is only used for input.  A new window (the
  254. X      Info/Xfer Status window) now shows what used to go there and the
  255. X      requester now comes up in this window.  The window is sizable,
  256. X      draggable, closeable and front-to-backable; when re-opened it
  257. X      will appear in its last location with its last dimensions.  The
  258. X      window ignores input but will become active when it's first
  259. X      displayed as well as when a requester is put up in it.  To
  260. X      cancel a transfer request, first ensure that the mail VT100
  261. X      windiw is active then hit ESC in it.
  262. X    - KERMIT mode has been hardened and wildcarded files can be sent
  263. X      to a KERMIT that is *not* in server mode.  E.g. you may say
  264. X      RECEIVE to your host's KERMIT then send Foo* -- all files
  265. X      starting with Foo in the current directory will be sent.
  266. X    - New command line switches -i and +i.  -I says don't use an init
  267. X      file, +i file says use "file".  User may also specify script
  268. X      files on the command line which will be executed in sequence.
  269. X    - New init file command SHORTCUT.  See vt100.doc.
  270. X    - I've included the font code.  It looks for an env variable named
  271. X      "font" (yes, lowercase) and, if found, uses that font for its
  272. X      test.  If you don't like it you may wanna remove it.  I was gonna
  273. X      ifdef it but I ran out of time.  Remember that there's a PD set
  274. X      cmd to allow Lattice users to set env vars.
  275. X    - Nagging bug: On 2nd and subsequent uses of the requester, the
  276. X      1st character of the last use is redisplayed.  Intuition bug?
  277. Xv2.6 870227 DBW - bug fixes for all the stuff in v2.5
  278. X    - Input requestors are now self selecting (ignore comment in 2.5)
  279. X    - Added a BS<->DEL menu item and startup option (SWAP ON/OFF)
  280. X    - Renamed dopen/dnext/dclose to diropen/dirnext/dirclose for LATTICE
  281. X    - Added a CONVERT option that tells whether KERMIT should downcase
  282. X    - MAJOR CHANGE: re write the INPUT/SCRIPT commands, see VT100.DOC
  283. X    - Fixed a major problem with Set Directory causing LOCK conflicts
  284. X    - Moved the Title up 1 pixel so that it doesn't get cut off anymore
  285. Xv2.5 870214 DBW - more additions (see readme file)
  286. X    - All prompting now done through a string requester/gadget.
  287. X      NOTE: YOU MUST SELECT THE INPUT STRING OF THE REQUESTER BEFORE
  288. X        YOU CAN TYPE A RESPONSE.
  289. X    - Local echo mode added (half duplex for Carolyn)
  290. X    - BEEP command added to SCRIPT
  291. X    - New menu/init/script items:
  292. X        CLEAR SCREEN    - clears the screen
  293. X         ECHO        - turns on/off half duplex mode
  294. X        WRAP        - turns on/off autowrap on long lines
  295. X        NUMKEY        - turns on/off numeric keypad mode
  296. X        APPCUR        - turns on/off application cursor mode
  297. X    - Rewrote toasc() to use qualifier field (no more getting the
  298. X      keyboard "stuck")
  299. X    - Fixed locking of directories (should now run under workbench ok)
  300. X    - Cleaned up VT100.H to really check includes on compile
  301. X    - Setting font explicitly to TOPAZ 8 (no more dumb assumptions)
  302. X
  303. Xv2.4 861214 DBW - lots of fixes/additions
  304. X    - Beep should now work under Lattice
  305. X    - CreatePort now passes longs (as it should always have)
  306. X    - Nested comments in KERMIT.C removed
  307. X    - Beep volume of 0 (DisplayBeep) now works
  308. X    - snum[] declaration in KERMIT.C fixed
  309. X    - multi_xfer is now void and return fixed (in kermit)
  310. X    - "." can no longer get "stuck" as the break key
  311. X
  312. X    - RIGHT-AMIGA-keys have been added for most menu items
  313. X    - The ALT key is now an EIGHTth bit shifter
  314. X    - Control-@, Control-2, Control-space send the NULL character
  315. X    - Control-6 now sends Control-^
  316. X    - Control-- and Control-? now sends Control-_
  317. X    - Cursor application mode (<esc>[?1h and <esc>[?1l) now work
  318. X    - XMODEM now masks the eighth bit if parity is other than NONE
  319. X
  320. Xv2.3 861101 DBW - minor bug fixes:
  321. X    - added p_wbcolors to allow workbench colors on custom screen
  322. X      (In the init file you can specify WBCOLORS to be NO (use color
  323. X       definitions in INIT FILE or VT100.H) or YES (use WORKBENCH
  324. X       colors for everything)).
  325. X    - "$" now sends a kermit-bye (like it says in VT100.DOC).
  326. X    - made window/screen heights more reasonable
  327. X    - Added ANSI insert line and delete line (<csi><num>L and
  328. X      <csi><num>M) to speed up various editors (like emacs).
  329. X      NOTE: This is NOT a VT100 sequence (new extension).
  330. X    - ctrl-space now also sends a null (along with ^@ and ^`)
  331. X    - RAWKEY fixed in WINDOW.C
  332. X    - p_wrap fixed in WINDOW.C
  333. X    - removed WRDMAX from VT100.H
  334. X    - fixed exit with no params in SCRIPT.C
  335. X    - fixed parity comparisons in KERMIT.C
  336. X    - init file [n+1] changed to [nplus1] to make Lattice happy.
  337. X    - cursoron(), cursoroff() changed to one routine cursorflip().
  338. X    - long lines shortened to less than 80 characters (for gateways).
  339. X    - blanks following exit (or comments) now work in scripts.
  340. X
  341. Xv2.2 861012 DBW - more of the same:
  342. X    - The INIT file "exit" can now chain to a script
  343. X    - The SCRIPT command "exit" can now chain to another script
  344. X    - Hangup menu item now works.
  345. X    - Autowrap can now be set from VT100.H, VT100.INIT (<esc>[?7h l)
  346. X    - Control-G is now handled with an audible beep
  347. X    - Script now used "^chr" to send control characters
  348. X    - The graphics "box" character (a) was added
  349. X    - Control-@ and Control-` now send the NULL character
  350. X    - Alternate color for BOLD has been re-instated by popular demand
  351. X    - Menus have been cleaned up.
  352. X    - Lattice compilation cleaned up.
  353. X    - No more wordsize parameter since PARITY takes care of all cases
  354. X    - Function keys can now call scripts
  355. X    - Double shift keys are now handled correctly.
  356. X    - Version has been added to the title bar (for bug reports).
  357. X
  358. Xv2.1 860915 DBW - new features / bug fixes
  359. X    - Now identifies as a VT100 (including the response to <esc>Z)
  360. X    - Cursor color now gets read in as hex (instead of decimal)
  361. X    - REPORTMOUSE taken out of definitions (not needed)
  362. X    - XON/XOFF now being handled by the device driver instead of me
  363. X    - Literal escape characters have been replaced with \033
  364. X    - At init time the user can now specify the input BUFFER size
  365. X      (typically between 512 and 2048 bytes) depending on baud rate
  366. X    - Script files are now case insensitive for commands
  367. X    - XMODEM now turns off the driver XON/XOFF during transfers
  368. X    - Graphic rendition now done by the OS instead of me.
  369. X    - Initialization files are now searched for in S: instead of C:
  370. X    - Forward GOTO bug fixed in the script package.
  371. X    - Keypad can now be used in both numeric and application mode
  372. X    - General purpose cleanup() routine added for all exits.
  373. X    - Utility menu added (sendbreak, hangup, change directory).
  374. X      NOTE: hangup is not implemented yet.
  375. X    - Full wild card support in file transfers (see vt100.doc).
  376. X    - Kermit cleaned up with better filename handling (from host).
  377. X    - Script now has CD (changed directory) and SB (send break) commands
  378. X    - Added Parity and Wordsize choices in VT100.H, VT100.INIT, menu
  379. X      and scripts. (Generates parity from a table).
  380. X    - Added 8th bit quoting in KERMIT when using 7 bit words (ODD or
  381. X      EVEN parity).
  382. X    - Break time can be set from VT100.H, VT100.INIT or a script file.
  383. X    - Transfer mode (image or CRLF) can now be set from a script file.
  384. X    - Control characters in escape sequences now act like a true VT100.
  385. X    - F10 now works from init files.
  386. X    - Right (or Left) AMIGA with period (".") sends a BREAK to the host
  387. X      from the keyboard.
  388. X    - XMODEM status kept down to one line for a file transfer.
  389. X
  390. Xv2.0 860823 DBW    - Major rewrite:
  391. X    - Emulator now compiles under either MANX or LATTICE by defining
  392. X      the appropriate compiler type in VT100.H.
  393. X    - Sped up code to an effective baud rate of (about) 8k. This means
  394. X      that clear text at 4800 baud should be no problem.
  395. X    - Added XON/XOFF generation so that characters should not get lost
  396. X      any more at 9600 baud (when receiving clear text).
  397. X    - Got rid of all command line switches and environment variables.
  398. X      Instead upon invocation the program searches first for any file
  399. X      named on the command line, then looks for VT100.INIT in the
  400. X      current directory and finally searches for C:VT100.INIT.
  401. X      All parameters can be set in the init file, and a sample VT100.INIT
  402. X      is provided in VT100.DOC that shows all possible options.
  403. X    - All parameters that are set by VT100.INIT are defined in VT100.H
  404. X      (variables starting with "p_"). This allows you to compile your
  405. X      own defaults into the code.
  406. X    - You can now set the number of lines (for all you EMACS freaks :-).
  407. X      On an interlaced screen this gives you upto a 48 line terminal.
  408. X    - WORKBENCH colors are NEVER touched.
  409. X    - In an attempt to keep the size down, the color palette menu item
  410. X      has been removed (current). Code is about 36K in size with a
  411. X      run time image (using workbench screen) of about 88k.
  412. X    - Many bugs fixed including reverse scrolling with descenders,
  413. X      reverse video at end of line, clearing with scrolling regions,
  414. X        ... and 20 or more others.
  415. X    - File capture now no longer sends the filename to the host.
  416. X    - BOLD (<esc>[1m) has now been added by using an additional color
  417. X      when you specify a depth of 2 (instead of 1) bitplane.
  418. X    - UNDERLINE (<esc>[4m) has now been added.
  419. X    - The handling of remote (host) escape sequences has been completly
  420. X      re-written (thanks to Dawn Banks for all the work).
  421. X    - Function keys (and shifted function keys) can now be bound to
  422. X      arbitrary strings (Jim Ravan gets his macros). See VT100.DOC
  423. X      for details.
  424. X    - Cursor has no been reduced to the size of a normal character for
  425. X      easier readability.
  426. X    - XMODEM has been improved (by Steve Drew) to use a timer device
  427. X      (for timeouts) and to abort immediately if the user types <ESC>.
  428. X    - KERMIT has been completely re-written and appears to work fine,
  429. X      thanks to the efforts of Steve Drew.
  430. X    - New menu item allows script file support. Module written by
  431. X      Steve Drew. See VT100.DOC for details.
  432. SHAR_EOF
  433. if `test ! -d RexxSamples`
  434. then
  435.   mkdir RexxSamples
  436.   echo "mkdir RexxSamples"
  437. fi
  438. echo "extracting RexxSamples/Forward.rexx"
  439. sed 's/^X//' << \SHAR_EOF > RexxSamples/Forward.rexx
  440. X/*   An AREXX macro to demonstrate the FORWARD command and its use.  It will
  441. X** open a port and request VT100 to forward received data to this port.  It
  442. X** will then await 3 messages from VT100 (3 batches of data) and then will ask
  443. X** VT100 to quit forwarding received data, close the port and exit.
  444. X**/
  445. X
  446. Xtrace R
  447. X
  448. Xaddress VT100-serial.device-00
  449. X
  450. Xif show("L", "rexxsupport.library") = 0
  451. Xthen call addlib "rexxsupport.library", 0, -30, 0
  452. X
  453. Xportname = "REXX-VT100"
  454. Xport = openport(portname)
  455. X
  456. Xif Port = '0000 0000'x
  457. Xthen do
  458. X    say "Couldn't open the port."
  459. X    exit 20
  460. Xend
  461. X
  462. X"FORWARD" portname
  463. X
  464. Xdo i = 1 to 3
  465. X    packet = getpkt(portname)
  466. X    if packet = '0000 0000'x
  467. X    then do
  468. X        call waitpkt portname
  469. X        packet = getpkt(portname)
  470. X    end
  471. X    call reply packet, 0
  472. Xend
  473. X
  474. X'FORWARD'
  475. X
  476. Xpacket = getpkt(portname)
  477. Xdo while packet ~= '0000 0000'x
  478. X    call reply packet, 0
  479. X    packet = getpkt(portname)
  480. Xend
  481. X
  482. Xcall closeport port
  483. X
  484. Xexit
  485. SHAR_EOF
  486. echo "extracting RexxSamples/Forwarding.rexx"
  487. sed 's/^X//' << \SHAR_EOF > RexxSamples/Forwarding.rexx
  488. X/* */
  489. Xtrace R
  490. X
  491. Xportname = "REXX-VT100"
  492. XPort = openport(portname)
  493. X
  494. Xif Port = '00000000'x
  495. Xthen do
  496. X    say "Couldn't open the port."
  497. X    exit 20
  498. Xend
  499. X
  500. Xaddress VT100-serial.device-00 "FORWARD" portname
  501. X
  502. Xdo i = 1 to 5
  503. X    call waitpkt portname
  504. X    packet = getpkt(portname)
  505. X    message.i = getarg(packet);
  506. X    call reply packet, 0
  507. Xend
  508. Xtrace ?R
  509. Xpacket = getpkt(portname)
  510. Xif packet ~= '00000000'x
  511. Xthen do
  512. X    message.6 = getarg(packet)
  513. X    call reply packet, 0
  514. Xend
  515. X
  516. Xcall closeport port
  517. X
  518. Xnop
  519. Xexit
  520. SHAR_EOF
  521. echo "extracting RexxSamples/FwdLogon.vt100"
  522. sed 's/^X//' << \SHAR_EOF > RexxSamples/FwdLogon.vt100
  523. X/*   This VT100 AREXX macro will try to log you onto a mythical machine at
  524. X** 555-1212.  This machine expects a username (signalled by the appearance of
  525. X** the character "gin:"), 2 passwords (eached signalled by "word:") and a
  526. X** terminal identifier (signalled by "#?").  If any step is unsuccessful this
  527. X** macro will abort and cause VT100 to issue an appropriate message.  If you
  528. X** get logged on via this macro, it will cause VT100 to display a success msg.
  529. X**
  530. X**   This macro uses the FORWARD and MSG commands of VT100 R2.9.  The FORWARD
  531. X** command is used to step through the login sequence.  This is a fairly slow
  532. X** process and is just used as an example.  If you would like to use some
  533. X** macro as a model, you would probably prefer to use OnLogon.vt100 as it
  534. X** runs MUCH faster.
  535. X**
  536. X**   Note that this macro uses the AmigaDOS WAIT command (in routine receive:).
  537. X** This WILL cause your disks to be accessed every second or so while awaiting
  538. X** receipt of a character from the serial port.  AREXX 1.10 has a delay()
  539. X** which you can use to replace the AmigaDOS WAIT command.  Simply comment out
  540. X** the WAIT and un-comment the delay.
  541. X**
  542. X** Tony Sumrall
  543. X**/
  544. Xtrace Off
  545. X
  546. Xarg phone
  547. X
  548. Xportname = "REXX-VT100"
  549. Xport = openport(portname)
  550. X
  551. Xif Port = '0000 0000'x
  552. Xthen do
  553. X    say "Couldn't open the port."
  554. X    exit 20
  555. Xend
  556. X
  557. X"FORWARD" portname
  558. Xif rc ~= 0
  559. Xthen exit
  560. X
  561. X"BAUD 2400"
  562. X
  563. Xif dial("DT555-1212") = 0
  564. Xthen do
  565. X    'MSG "Dial failed."'
  566. X    call cleanup 20
  567. Xend
  568. X
  569. Xdo i = 1 to 5 while get_match(5, "gin:") ~= 2
  570. X    'SEND "^M"'
  571. Xend
  572. X
  573. Xif login("acs^M", "word:", "1st-pwd^M", "word:", "2nd-pwd^M",,
  574. X    "#?", "1^M") = 0
  575. Xthen do
  576. X    'MSG "Login failed."'
  577. X    call cleanup 20
  578. Xend
  579. X
  580. X'MSG "Logon successful!"'
  581. Xcall cleanup 0
  582. Xexit
  583. X
  584. X/*   Dial the specified number(s).  If we get no connection we keep going till
  585. X** we get a connection.  If we never get one then we return 0 for failure else
  586. X** we return 1 for success.
  587. X**/
  588. Xdial: procedure expose port portname
  589. Xnumargs = arg()
  590. X
  591. Xmsgdata = ""
  592. Xdo i = 1 to numargs
  593. X    'SEND "AT' || arg(i) || '^M"'
  594. X    if get_match(40, "CONNECT", "BUSY", "NO") = 2
  595. X    then leave
  596. Xend
  597. X
  598. Xif i > numargs
  599. Xthen return 0    /* Failure */
  600. Xelse return 1    /* Success */
  601. X
  602. X/*   Login to a host.  We get send/expect sequences and we have to match a prior
  603. X** sequence before going on to the next one.  If we ever miss a match we return
  604. X** 0 for failure; if we match on all args we return 1 for success.
  605. X**/
  606. Xlogin: procedure expose port portname
  607. Xnumargs = arg()
  608. X
  609. Xmsgdata = ""
  610. Xfailures = 0
  611. Xdo i = 1 to numargs
  612. X    if i // 2 = 1
  613. X    then 'SEND "' || arg(i) || '"'
  614. X    else if get_match(5, arg(i)) ~= 2
  615. X    then return 0
  616. Xend
  617. X
  618. Xreturn 1
  619. X
  620. X/*   Get a match from the serial port via VT100.  1st arg is the maximum time
  621. X** we'll wait; subsequent args are "acceptable" match strings.  We return the
  622. X** arg() index of the matched string so if we ever time out we'll return 1
  623. X** (since that's the index of the max time arg).
  624. X**/
  625. Xget_match: procedure expose port portname
  626. Xnumargs = arg()
  627. Xlongest = 0
  628. Xdo i = 2 to numargs
  629. X    longest = max(longest, length(arg(i)))
  630. Xend
  631. X
  632. Xmsgdata = ""
  633. Xmaxtime = arg(1)
  634. Xdo forever
  635. X    msg = receive(maxtime)
  636. X    if msg == ""
  637. X    then return 1
  638. X
  639. X    msgdata = msgdata || msg
  640. X    do i = 2 to numargs
  641. X        ndx = index(msgdata, arg(i))
  642. X        if ndx > 0
  643. X        then leave
  644. X    end
  645. X    if i <= numargs
  646. X    then return i
  647. X
  648. X    if length(msgdata) > longest
  649. X    then msgdata = right(msgdata, longest - 1)
  650. Xend
  651. X
  652. X/*   Don't use the AREXX waitpkt() function as that locks us up until something
  653. X** arrives at the port.  Instead, use the AmigaDOS WAIT command or, if you have
  654. X** AREXX 1.10 or later, the AREXX delay() function.
  655. X**/
  656. Xreceive: procedure expose port portname
  657. Xarg waittime
  658. X
  659. Xtime = 0
  660. Xpacket = getpkt(portname)
  661. Xdo while packet = '0000 0000'x
  662. X    if waittime ~= 0
  663. X    then do
  664. X        if time > waittime
  665. X        then return ""
  666. X        address COMMAND "WAIT 1 SEC"    /* AmigaDOS */
  667. X/*        call delay 50                    /* AREXX 1.10 or above */ */
  668. X        time = time + 1
  669. X    end
  670. X    else call waitpkt portname
  671. X    packet = getpkt(portname)
  672. Xend
  673. Xmsg = getarg(packet)
  674. Xcall reply packet, 0
  675. X
  676. Xretval = ""
  677. Xdo while length(msg) > 0
  678. X    parse var msg first '00'x msg
  679. X    retval = retval || first
  680. Xend
  681. X
  682. Xreturn retval
  683. X
  684. Xcleanup: procedure expose port portname
  685. Xarg retc
  686. X
  687. X'FORWARD'
  688. X
  689. Xpacket = getpkt(portname)
  690. Xdo while packet ~= '0000 0000'x
  691. X    call reply packet, 0
  692. X    packet = getpkt(portname)
  693. Xend
  694. X
  695. Xcall closeport port
  696. X
  697. Xexit retc
  698. SHAR_EOF
  699. echo "extracting RexxSamples/OnLogon.vt100"
  700. sed 's/^X//' << \SHAR_EOF > RexxSamples/OnLogon.vt100
  701. X/*   This VT100 AREXX macro will try to log you onto a mythical machine at
  702. X** 555-1212.  This machine expects a username (signalled by the appearance of
  703. X** the character "gin:"), 2 passwords (eached signalled by "word:") and a
  704. X** terminal identifier (signalled by "#?").  If any step is unsuccessful this
  705. X** macro will abort and cause VT100 to issue an appropriate message.  If you
  706. X** get logged on via this macro, it will cause VT100 to display a success msg.
  707. X**
  708. X**   This macro uses the ON, FORWARD and MSG commands of VT100 R2.9.  The ON
  709. X** command is used to step this macro through each of the login steps.  You
  710. X** can probably modify this macro a little and use it yourself.
  711. X**
  712. X**   Note that this macro uses the AmigaDOS WAIT command (in routine receive:).
  713. X** This WILL cause your disks to be accessed every second or so while awaiting
  714. X** receipt of a character from the serial port.  AREXX 1.10 has a delay()
  715. X** which you can use to replace the AmigaDOS WAIT command.  Simply comment out
  716. X** the WAIT and un-comment the delay.
  717. X**
  718. X** Tony Sumrall
  719. X**/
  720. Xtrace Off
  721. X
  722. Xif show("L", "rexxsupport.library") = 0
  723. Xthen call addlib "rexxsupport.library", 0, -30, 0
  724. X
  725. Xif arg() = 0
  726. Xthen do
  727. X    portname = "REXX-VT100"
  728. X    port = openport(portname)
  729. X
  730. X    if Port = '0000 0000'x
  731. X    then do
  732. X        say "Couldn't open the port."
  733. X        exit 20
  734. X    end
  735. X
  736. X    "FORWARD" portname
  737. X    if rc ~= 0
  738. X    then exit
  739. X
  740. X    "BAUD 2400"
  741. X
  742. X    if dial("DT555-1212") = 0
  743. X    then do
  744. X        'MSG "Dial failed."'
  745. X        call cleanup 20
  746. X    end
  747. X
  748. X    do i = 1 to 5    /* Try 5 times to get a login prompt */
  749. X        'SEND "^M"'
  750. X
  751. X        if get_match(2, "gin:") = 2
  752. X        then leave
  753. X    end
  754. X    if i > 5
  755. X    then do
  756. X        'MSG "No login prompt!"'
  757. X        call cleanup 20
  758. X    end
  759. X
  760. X    call cleanup -1
  761. X
  762. X    'ON "word:" rx onlogon pwd1'    /* Setup for 1st password */
  763. X    'SEND "acs^M"'
  764. Xend
  765. Xelse do
  766. X    parse upper arg cmd
  767. X    if cmd = "PWD1"
  768. X    then do
  769. X        /*   First password prompt */
  770. X        'SEND "your-pwd^M"'
  771. X        'ON "word:" rx onlogon pwd2'    /* Setup for 2nd password */
  772. X        exit 0
  773. X    end
  774. X    else if cmd = "PWD2"
  775. X    then do
  776. X        /*   Second password prompt */
  777. X        'SEND "2nd-pwd^M"'
  778. X        'ON "#?" rx onlogon termtp'    /* Setup for term type prompt */
  779. X        exit 0
  780. X    end
  781. X    else if cmd = "TERMTP"
  782. X    then do
  783. X        /*   Send our terminal type.  While we're at it, cancel any
  784. X        ** outstanding ON commands. */
  785. X        'ON ""'
  786. X        'SEND "1^M"'
  787. X        'MSG "Logon successful!"'
  788. X        exit 0
  789. X    end
  790. X    else do
  791. X        'MSG "Unknown command:' cmd || '"'
  792. X        exit 20
  793. X    end
  794. Xend
  795. X
  796. Xexit 0
  797. X
  798. X
  799. X/*   Dial the specified number(s).  If we get no connection we keep going till
  800. X** we get a connection.  If we never get one then we return 0 for failure else
  801. X** we return 1 for success.
  802. X**/
  803. Xdial: procedure expose port portname
  804. Xnumargs = arg()
  805. X
  806. Xmsgdata = ""
  807. Xdo i = 1 to numargs
  808. X    'SEND "AT' || arg(i) || '^M"'
  809. X    if get_match(40, "CONNECT", "BUSY", "NO") = 2
  810. X    then leave
  811. Xend
  812. X
  813. Xif i > numargs
  814. Xthen return 0    /* Failure */
  815. Xelse return 1    /* Success */
  816. X
  817. X/*   Get a match from the serial port via VT100.  1st arg is the maximum time
  818. X** we'll wait; subsequent args are "acceptable" match strings.  We return the
  819. X** arg() index of the matched string so if we ever time out we'll return 1
  820. X** (since that's the index of the max time arg).
  821. X**/
  822. Xget_match: procedure expose port portname
  823. Xnumargs = arg()
  824. Xlongest = 0
  825. Xdo i = 2 to numargs
  826. X    longest = max(longest, length(arg(i)))
  827. Xend
  828. X
  829. Xmsgdata = ""
  830. Xmaxtime = arg(1)
  831. Xdo forever
  832. X    msg = receive(maxtime)
  833. X    if msg == ""
  834. X    then return 1
  835. X
  836. X    msgdata = msgdata || msg
  837. X    do i = 2 to numargs
  838. X        ndx = index(msgdata, arg(i))
  839. X        if ndx > 0
  840. X        then leave
  841. X    end
  842. X    if i <= numargs
  843. X    then return i
  844. X
  845. X    if length(msgdata) > longest
  846. X    then msgdata = right(msgdata, longest - 1)
  847. Xend
  848. X
  849. X/*   Don't use the AREXX waitpkt() function as that locks us up until something
  850. X** arrives at the port.  Instead, use the AmigaDOS WAIT command or, if you have
  851. X** AREXX 1.10 or later, the AREXX delay() function.
  852. X**/
  853. Xreceive: procedure expose port portname
  854. Xarg waittime
  855. X
  856. Xtime = 0
  857. Xpacket = getpkt(portname)
  858. Xdo while packet = '0000 0000'x
  859. X    if waittime ~= 0
  860. X    then do
  861. X        if time > waittime
  862. X        then return ""
  863. X        address COMMAND "WAIT 1 SEC"    /* AmigaDOS */
  864. X/*        call delay 50                    /* AREXX 1.10 or above */ */
  865. X        time = time + 1
  866. X    end
  867. X    else call waitpkt portname
  868. X    packet = getpkt(portname)
  869. Xend
  870. Xmsg = getarg(packet)
  871. Xcall reply packet, 0
  872. X
  873. Xretval = ""
  874. Xdo while length(msg) > 0
  875. X    parse var msg first '00'x msg
  876. X    retval = retval || first
  877. Xend
  878. X
  879. Xreturn retval
  880. X
  881. Xcleanup: procedure expose port portname
  882. Xarg retc
  883. X
  884. X'FORWARD'
  885. X
  886. Xpacket = getpkt(portname)
  887. Xdo while packet ~= '0000 0000'x
  888. X    call reply packet, 0
  889. X    packet = getpkt(portname)
  890. Xend
  891. X
  892. Xcall closeport port
  893. X
  894. Xif retc = -1
  895. Xthen return
  896. X
  897. Xexit retc
  898. SHAR_EOF
  899. echo "extracting RexxSamples/TestDisplay.vt100"
  900. sed 's/^X//' << \SHAR_EOF > RexxSamples/TestDisplay.vt100
  901. X/*   This routine shows the capabilities of the DISPLAY VT100 script command.
  902. X** It will write data to the screen both one character at a time as well as
  903. X** a string at a time and makes use of the defined VT100 escape sequences to
  904. X** cause the cursor to move non-destructively.
  905. X**
  906. X** ACS 08/28/89
  907. X**/
  908. Xtrace Off
  909. X
  910. Xcr = "^M"
  911. Xlf = "^J"
  912. X
  913. X"display" cr    /* Cursor back to first column */
  914. X"display" lf    /* Cursor down one line        */
  915. X
  916. X"display ""Here is some data" || cr || lf || '"'
  917. X
  918. X"display ""Gonna delete this line."""
  919. Xaddress COMMAND 'WAIT 3 SEC'
  920. X'display "^[[M"'    /* Issue escape sequence to delete 1 line */
  921. X
  922. X"display" cr    /* Cursor back to first column */
  923. X"display" lf    /* Cursor down one line        */
  924. X
  925. X/*   Write "Move" on one line, move the cursor up one line without changing
  926. X** the column and write "up one line". */
  927. X'display "Move^[[Aup one line"'
  928. X
  929. Xexit 0
  930. SHAR_EOF
  931. echo "extracting RexxSamples/TestErrs.vt100"
  932. sed 's/^X//' << \SHAR_EOF > RexxSamples/TestErrs.vt100
  933. X/* Show return codes generated as a result of various error conditions. */
  934. Xtrace Off
  935. X
  936. X/* NONREXX command issued from an AREXX macro: CMDFAIL */
  937. Xcmd = "WAIT ""JUNK"""
  938. Xcmd
  939. Xsay cmd "yielded RC =" rc
  940. X
  941. X/* Invalid BAUD rate: CMDFAIL */
  942. Xcmd = "BAUD 123456789"
  943. Xcmd
  944. Xsay cmd "yielded RC =" rc
  945. X
  946. X/* INIT command issued from a script: CMDBS */
  947. Xcmd = "SCREEN CUSTOM"
  948. Xcmd
  949. Xsay cmd "yielded RC =" rc
  950. X
  951. Xcmd = "EXTERNAL 1234567890 ""FOO"" ""BAR"""
  952. Xcmd
  953. Xsay cmd "yielded RC =" rc
  954. X
  955. X/* Unknown command will be given to AREXX.  Probably RC0 */
  956. Xcmd = "FARKEL"
  957. Xcmd
  958. Xsay cmd "yielded RC =" rc
  959. X
  960. Xexit
  961. SHAR_EOF
  962. echo "extracting RexxSamples/TestFor.rexx"
  963. sed 's/^X//' << \SHAR_EOF > RexxSamples/TestFor.rexx
  964. X/* */
  965. Xtrace R
  966. X
  967. Xportname = "REXX-VT100"
  968. XPort = openport(portname)
  969. X
  970. Xif Port = '00000000'x
  971. Xthen do
  972. X    say "Couldn't open the port."
  973. X    exit 20
  974. Xend
  975. X
  976. Xaddress VT100-serial.device-00 "FORWARD" portname
  977. X
  978. Xtrace ?R
  979. X/*  Need to getpkt(port), getarg(packet), reply(packet,0) */
  980. Xpacket = getpkt(portname)
  981. Xif packet ~= '00000000'x
  982. Xthen do
  983. X    message.6 = getarg(packet)
  984. X    call reply packet, 0
  985. Xend
  986. X
  987. Xcall closeport port
  988. X
  989. Xnop
  990. Xexit
  991. SHAR_EOF
  992. echo "extracting RexxSamples/TestMsg.vt100"
  993. sed 's/^X//' << \SHAR_EOF > RexxSamples/TestMsg.vt100
  994. X/*   Have VT100 display messages for us */
  995. Xtrace Off
  996. X
  997. Xparse source . . . cmdname .
  998. X
  999. X'MSG "From' cmdname || ': A little demo"'
  1000. X'MSG "Watch this line get overlaid by the next...^M"'
  1001. Xaddress COMMAND "WAIT 2 SECS"
  1002. X'MSG "This data has overlaid the previous message."'
  1003. X'MSG "Now we''ll leave a blank line..."'
  1004. X"MSG"
  1005. X'MSG "All done with' cmdname '"'
  1006. X
  1007. Xexit
  1008. SHAR_EOF
  1009. if `test ! -d Zmodem`
  1010. then
  1011.   mkdir Zmodem
  1012.   echo "mkdir Zmodem"
  1013. fi
  1014. echo "extracting Zmodem/README.1ST"
  1015. sed 's/^X//' << \SHAR_EOF > Zmodem/README.1ST
  1016. XNote that, while a makefile is provided for Un*x, I do not plan to support
  1017. Xthis Un*x version of the zmodem programs.  There are newer versions out
  1018. Xthere for sz and rz which should be readily available to you.  Note that I
  1019. X*am* working on updating the Amiga version of rz and sz; the results of
  1020. Xmy efforts will be made available later.
  1021. X
  1022. XAlso note that this is NOT an XPR -- 2.9 of VT100 does not support the XPR
  1023. Xprotocol specification.  2.10 will.
  1024. X
  1025. XThis version of sz has a bug in Ymodem-batch in that it does not update
  1026. Xthe "packet" count.  I know that this is inconvenient.  It will be repaired
  1027. Xin a subsequent release.
  1028. X---
  1029. XTony Sumrall
  1030. SHAR_EOF
  1031. echo "extracting Zmodem/Amiga.doc"
  1032. sed 's/^X//' << \SHAR_EOF > Zmodem/Amiga.doc
  1033. X
  1034. X                 Amiga zmodem
  1035. X                 ------------
  1036. X
  1037. X
  1038. X
  1039. X Zmodem is a file transfer protocol which will enable you to transmit files
  1040. Xbetween different computers. In fact the zmodem programs can transfer files
  1041. Xusing several popular protocols: Xmodem,Ymodem and Zmodem. To find out about
  1042. Xall the features of the zmodem programs, be sure to read rz.doc and sz.doc,
  1043. Xbecause I will only mention the features specific to the amiga version here.
  1044. X Please note that some features of UNIX zmodem are not supported. This is
  1045. Xmentioned in the zmodem '.doc' files.
  1046. X
  1047. X The reason I ported these programs to the Amiga, is that Zmodem file transfers
  1048. Xare very fast. When I was using Kermit the throughput I got was about 30
  1049. Xcharacters/second (1200 baud modem, going through packet switching network), now
  1050. Xwith Amiga zmodem I get at least 100 characters/second. Your mileage may
  1051. Xvary, but I'm pretty sure you'll get a significant speedup if you've been
  1052. Xusing either Kermit or Xmodem. Enjoy!
  1053. X
  1054. X            CONTENTS
  1055. X
  1056. X         I     Installing zmodem
  1057. X         II  Quick explanation on transferring files
  1058. X         III Cooperating communications programs
  1059. X         IV  Amiga specific features
  1060. X         V     Caveats,bugs and "features" (sigh!)
  1061. X
  1062. X
  1063. X I/ Installing zmodem
  1064. X
  1065. X To install UNIX zmodem rename the file 'makefile.unix' as 'makefile'. Then
  1066. Xtype 'make system'. Where system is the version of UNIX you are using, and is
  1067. Xone of the following:
  1068. X
  1069. X    sysv        for SYSTEM 5 Unix
  1070. X    xenix        for SYSTEM 3/5 Xenix
  1071. X    x386        for 386 Xenix
  1072. X    bsd        for Berkeley 4.x BSD and Ultrix
  1073. X
  1074. X To install Amiga zmodem just uudecode the files rz.uu and sz.uu, and you're
  1075. Xready to go.
  1076. X
  1077. X
  1078. X
  1079. X II/ Quick explanation on transferring files
  1080. X
  1081. X Sending files from UNIX to the AMIGA using zmodem:
  1082. X
  1083. X                (log in on UNIX machine)
  1084. X                (make sure preferences has the correct serial
  1085. X                 setup, or that you have the zmodem.init file
  1086. X                 correctly set up, or a cooperating
  1087. X                 comm. program running)
  1088. X
  1089. X    sz file1 file2 ...        (type this on your UNIX system)
  1090. X                (exit your communications program)
  1091. X    rz                (type this on the Amiga)
  1092. X
  1093. X Sending files from the Amiga to UNIX using zmodem:
  1094. X
  1095. X                (log in on UNIX machine)
  1096. X                (if your comm. program doesn't cooperate
  1097. X                 exit it.)
  1098. X                (make sure preferences has the correct serial
  1099. X                 setup, or that you have the zmodem.init file
  1100. X                 correctly set up, or a cooperating
  1101. X                 comm. program running)
  1102. X    sz file1 file2 ...        (type this on the Amiga, Amiga sz automatically
  1103. X                 fires up UNIX rz)
  1104. X
  1105. X
  1106. X
  1107. X III/ Cooperating communications programs
  1108. X
  1109. X There are many different protocols for transferring files from one
  1110. Xcomputer to another. So many in fact, that almost no terminal program
  1111. Xcan support them all! So my idea was to provide a stand along program
  1112. Xthat would work with a terminal program. This would allow more efficient
  1113. Xuse of the computer's memory because the file transfer program would only
  1114. Xbe in memory when it was actually being used. Also authors of terminal
  1115. Xprograms could concentrate their efforts on other issues. The unique
  1116. Xfeatures of the Amiga make this idea possible.
  1117. X
  1118. X Zmodem can cooperate with other programs using the serial port. For this
  1119. Xto work, the other program has to do two things:
  1120. X
  1121. X    - Open the serial port in shared mode
  1122. X    - suspend it's read operations while zmodem is transferring files
  1123. X
  1124. X Actually it's also a good idea to suspend write operations also, because
  1125. Xaccidental keyboard input could interfere with the file transfer.
  1126. X
  1127. X An example of a cooperating communications program should be the new
  1128. Xversion of VT100 (r. 2.9).
  1129. X
  1130. X If your comm. program doesn't cooperate, you can still be use Amiga zmodem.
  1131. XJust exit your non-cooperating comm. program before running zmodem. If your
  1132. Xmodem drops the line when you exit (ie. when DTR goes down), just use the
  1133. Xbuilt in terminal mode in zmodem ('-T' switch).
  1134. X
  1135. X
  1136. X
  1137. X
  1138. X IV/ Amiga specific features
  1139. X
  1140. X  a/Initializing the serial port
  1141. X
  1142. X A new amiga specific switch '-I' has been added to allow initialization of
  1143. Xthe serial port parameters. If this switch is used, zmodem will look
  1144. Xfor a file called 'zmodem.init', which can either be in the current
  1145. Xdirectory, or the 'S:' directory.
  1146. X
  1147. X The file has the following format: 1 line composed of
  1148. X
  1149. X--------------------
  1150. Xbaudrate nps
  1151. X--------------------
  1152. X
  1153. X Where 'baudrate' is a number between 110 and 29,200 representing the
  1154. Xtransmission speed to be used.
  1155. X
  1156. X Where 'n' is the number of bits per character (7 or 8).
  1157. X
  1158. X Where 'p' is the parity to be used. The value of 'p' will be
  1159. Xone of: 'N','E','O' (standing for None,Even and Odd respectively)
  1160. X
  1161. X And where 's' is the number of stop bits (between 0 and 2).
  1162. X
  1163. X So if you want your file transfers to take place at 2400 bits per second,
  1164. X8 bits per character, no parity and 1 stop bit, you would place the following
  1165. Xline in your zmodem.init file:
  1166. X
  1167. X2400 8N1
  1168. X
  1169. X These parameters have to be on the first line of the file, no other lines
  1170. Xwill be examined. Also, if the zmodem.init file is not found, then the '-I'
  1171. Xswitch will be ignored.
  1172. X
  1173. X If no '-I' is given on the command line, then default parameters are
  1174. Xused. This means that if a cooperating program using the serial port is in
  1175. Xuse, then the default parameters are the ones set up by that program.
  1176. XOtherwise the default parameters are the ones you have specified using
  1177. Xpreferences. If you use preferences to specify the serial parameters you must
  1178. Xdisenable xON/xOFF handshaking for Xmodem and Ymodem transfers to work
  1179. Xcorrectly.
  1180. X
  1181. X If the terminal program you are using doesn't cooperate, then zmodem will
  1182. Xtell you that it can't open the serial port for transferring files, and
  1183. Xabort its execution. In that case stop the terminal program before
  1184. Xrunning zmodem.
  1185. X
  1186. X When a cooperating terminal program is running, it isn't possible to
  1187. Xuse the '-I' option. The parameters used will be automatically those
  1188. Xset up by the terminal program. If you try the '-I' option under these
  1189. Xconditions zmodem will print an error message and abort.
  1190. X
  1191. X  b/ Aborting file transfers
  1192. X
  1193. X Zmodem can be aborted at any time by clicking in the close box of the zmodem
  1194. Xwindow.
  1195. X
  1196. X  c/ Files to large for space remaining on disk
  1197. X
  1198. X Amiga zmodem will detect if the incoming file is too large to fit on the
  1199. Xcurrent disk. The files that won't fit are skipped. Zmodem only checks the
  1200. Xspace remaining at the start of each file, so you may still get full
  1201. Xdisks, if you use up some of the remaining free space while the file
  1202. Xtransfer is going on (hurrah for multi-tasking:-). This feature can be
  1203. Xdisabled with the '-n' option, which is useful if the destination device
  1204. Xhappens to be RAM:. That's because RAM:, is always full, so you couldn't
  1205. Xreceive any files on it at all.
  1206. X
  1207. X  d/ Ymodem file transfers
  1208. X
  1209. X With the UNIX version of zmodem, Ymodem transfers were requested by calling
  1210. Xzmodem using the names sb or rb (send batch or receive batch). But on
  1211. Xthe amiga this isn't practical, since this would require keeping several
  1212. Xcopies of zmodem, with only the name being different. To remedy this
  1213. Xsituation, the '-B' switch was added, this lets you use the Ymodem protocol
  1214. Xand have only one copy of zmodem around.
  1215. X
  1216. Xexamples: sz -B f1 f2 f3
  1217. X      rz -B
  1218. X
  1219. X e/ Xmodem file transfers
  1220. X
  1221. X To send with the xmodem protocol use: 'sz -X file', and for receiving
  1222. X'rz file'. If you give a file name to rz, the file transfer will
  1223. Xbe done using Xmodem protocol, even if on the sending end you specified
  1224. Xa zmodem transfer, so watch out!
  1225. X
  1226. X
  1227. X f/ Maintaining file protection bits
  1228. X
  1229. X When transferring between UNIX and the Amiga, the file protection
  1230. Xbits are also transfered. When sending from the amiga to UNIX the bits 'rwe'
  1231. Xare translated into the 'rwe' for user bits on UNIX. UNIX doesn't have a
  1232. X'd' bit, but if you don't have write permission rm will ask for permission
  1233. Xto over-ride protection (ie. you can't delete it accidentally). So the UNIX
  1234. X 'w' bit is translated into the Amiga 'wd' bits. That is to say if the UNIX
  1235. Xfile doesn't have write permission the Amiga file won't have write or delete
  1236. Xpermission. The transmission of the file protection bits can be overriden,
  1237. Xwith the '-m' option. In this case the transmitted files will have the
  1238. Xdefault file protection bits.
  1239. X
  1240. X
  1241. X g/ Automatic ASCII transfer mode
  1242. X
  1243. X To be able to transfer raw binary files zmodem needs 8 bits per
  1244. Xcharacter. If the serial port parameters aren't set up this way zmodem
  1245. Xautomatically uses it's ASCII transfer mode. The transfer mode being used
  1246. Xby zmodem is printed when the file transfer starts. You should transfer
  1247. Xfiles using binary mode for files you want transferred without any changes
  1248. Xmade to them. The ASCII mode will try to adapt the incoming file to
  1249. Xamiga text file conventions ( all CR LF sequences replaced by LF ).
  1250. X
  1251. X h/ Maintaining file dates
  1252. X
  1253. X One of the features of Zmodem, is that it keeps the same file-modification
  1254. Xdate on the source and destination files. But due to the format used to
  1255. Xtransmit the date, zmodem has to know what time zone you are in, relative
  1256. Xto the GM (Greenwich Meridian). I know this is strange, but that's the
  1257. Xway zmodem works. This time zone difference can also change during the year,
  1258. Xbecause GMT doesn't have any daylight savings time! Anyway, if you want
  1259. Xthe file dates maintained you must add an extra number (this is an option)
  1260. Xinto your zmodem.init file which specifies the difference between your local
  1261. Xtime zone and GMT.
  1262. X
  1263. X In this case the format of the zmodem.init file becomes:
  1264. X
  1265. X---------------------
  1266. Xbaudrate nps gmt_diff
  1267. X---------------------
  1268. X
  1269. Xmy zmodem.init file is
  1270. X
  1271. X  1200 8N1 +2  (this is for europe)
  1272. X
  1273. XIf you are in the EST time zone, you will probably set gmt_diff to -4.
  1274. XIf you don't care about the file-modification date on the transfered file,
  1275. Xthe easiest thing to do is just leave gmt_diff out. Then the transfered
  1276. Xfile's date will be set by zmodem to the current date.
  1277. X
  1278. X
  1279. X i/ Terminal mode
  1280. X
  1281. X A very primitive terminal mode has been provided, to enable those with "smart"
  1282. Xmodems (ie. ones that drop phone connection when DTR goes down) to use zmodem.
  1283. XUse the terminal mode to log in, and then click on the close box of the zmodem
  1284. Xwindow, the file transfer requested will follow automatically. Once the file
  1285. Xtransfer is completed, zmodem will re-enter the terminal mode, permitting
  1286. Xyou to log out cleanly.
  1287. X
  1288. X
  1289. X
  1290. X V/ Caveats,bugs and "features" (sigh!)
  1291. X
  1292. X If Ymodem protocol is used by the sending program, and the receiving
  1293. Xprogram is using Xmodem, the first file will be transferred, but the
  1294. Xsending Ymodem program will not exit correctly.
  1295. X
  1296. Xexample: sz foo        <-- starts out with Zmodem, steps down to Ymodem
  1297. X     rz foo        <-- uses Xmodem because file name is given
  1298. X
  1299. X the correct sequences would be:
  1300. X
  1301. X  sz foo bar toto    <-- Zmodem transfer
  1302. X  rz
  1303. X
  1304. X or
  1305. X  sz -B foo bar toto    <-- Batch Ymodem transfer
  1306. X  rz -B
  1307. Xor
  1308. X  sz -X foo       <-- Xmodem transfer
  1309. X  rz foo
  1310. X
  1311. X
  1312. X When using the '-f' option of sz (send whole pathname) the directories in
  1313. Xthe path will not be created. If one of the directories in the pathname
  1314. Xdoesn't exist, the file will not be sent. A newer version of UNIX rz will
  1315. Xhandle the creation of the directories. Amiga rz still doesn't though.
  1316. X
  1317. X If you are using parity, amiga zmodem won't accept any characters without
  1318. Xthe parity bit correctly set. Many UNIX hosts won't set the parity bit
  1319. Xcorrectly on output even if they are set up to check parity on input.
  1320. XI recommend  avoiding using parity with zmodem whenever possible.
  1321. XIt limits you to transferring just text files anyway.
  1322. X
  1323. X Sz's -n (send file iff newer) and -N (send file if newer or longer) options
  1324. Xare not implemented in Unix or Amiga zmodem.
  1325. X
  1326. X Sz's -r (resume interupted file transfer) option isn't implemented in this
  1327. Xversion of UNIX zmodem, or Amiga zmodem.
  1328. X
  1329. X Sz's -y (overwrite existing files with same name) option is pretty useles
  1330. Xwith the UNIX and Amiga versions of zmodem, because this is already the
  1331. Xdefault behavior.
  1332. X
  1333. X I haven't been able to test Amiga zmodem at speeds other than 1200 bps.
  1334. XI hope that zmodem will be reasonably efficient and bug free using
  1335. Xdifferent speeds. If rz can't keep up at higher speeds, it may be
  1336. Xnecessary to increase the size of the serial buffer using preferences.
  1337. XIf you increase the buffer size, don't use the '-I' option. With the
  1338. X'-I' option the buffer size is always the same no matter what you choose
  1339. Xin preferences (1024 bytes).
  1340. X
  1341. X---------------------------------------------------------------------------
  1342. X
  1343. X Many thanks to Chuck Forsberg who wrote the UNIX version of zmodem, and on
  1344. Xwhich Amiga zmodem is based. Thanks also go to all the good people who
  1345. Xhave helped to make the amiga the useful and successful machine it is
  1346. Xtoday. The people from Los Gatos, and CATS. And also those who have
  1347. Xprovided the public domain tools that have made this program possible,
  1348. XMatt Dillon for DME and the shell, Steve Drew for his work on the shell,
  1349. XDave Wecker and Tony Sumrall for the vt100 terminal program, Peter Da Silva
  1350. Xfor Browser, and all the other PD authors who's programs I've used. And of
  1351. Xcourse Fred Fish, for making all the PD software available.
  1352. X
  1353. X Please send bug reports and/or bug corrections to me:
  1354. X
  1355. X
  1356. X  Frank Anthes-Harper
  1357. X  72, Le Puech des Bruyeres
  1358. X  Av. de Mr. Teste
  1359. X  34070 Montpellier
  1360. X  France
  1361. X
  1362. XUsenet:  ...!ucbvax!decvax!uunet!mcvax!inria!geocub!anthes
  1363. SHAR_EOF
  1364. echo "extracting Zmodem/sz.doc"
  1365. sed 's/^X//' << \SHAR_EOF > Zmodem/sz.doc
  1366. X
  1367. X
  1368. X
  1369. XSZ(1)               UNIX Programmer's Manual                SZ(1)
  1370. X
  1371. X
  1372. X
  1373. XNAME
  1374. X     sx, sb, sz - XMODEM, YMODEM, ZMODEM file send
  1375. X
  1376. XSYNOPSIS
  1377. X     sz [-+1abdefkLlNnopqTtuvyY] file ...
  1378. X     sb [-1adfkqtuv] file ...
  1379. X     sx [-1akqtuv] file
  1380. X     sz [-1oqtv] -c COMMAND
  1381. X     sz [-1oqtv] -i COMMAND
  1382. X
  1383. XDESCRIPTION
  1384. X     Sz uses the ZMODEM, YMODEM or XMODEM error correcting proto-
  1385. X     col to send one or more files over a serial port to a
  1386. X     variety of programs running under PC-DOS, CP/M, Unix, VMS,
  1387. X     and other operating systems.
  1388. X
  1389. X
  1390. X     The first form of sz sends one or more files with ZMODEM
  1391. X     protocol.
  1392. X
  1393. X     ZMODEM greatly simplifies file transfers compared to XMODEM.
  1394. X     In addition to a friendly user interface, ZMODEM provides
  1395. X     Personal Computer and other users an efficient, accurate,
  1396. X     and robust file transfer method.
  1397. X
  1398. X     ZMODEM provides complete END-TO-END data integrity between
  1399. X     application programs.  ZMODEM's 32 bit CRC catches errors
  1400. X     that sneak into even the most advanced networks.
  1401. X
  1402. X     Advanced file management features include AutoDownload
  1403. X     (Automatic file Download initiated without user interven-
  1404. X     tion), Crash Recovery, selective file transfers, and preser-
  1405. X     vation of exact file date and length.
  1406. X
  1407. X>Not implemented in amiga version
  1408. X>     Output from another program may be piped to sz for transmis-
  1409. X>     sion by denoting standard input with "-":
  1410. X>                 ps -ef | sz -
  1411. X>     The program output is transmitted with the filename sPID.sz
  1412. X>     where PID is the process ID of the sz program.  If the
  1413. X>     environment variable ONAME is set, that is used instead.    In
  1414. X>     this case, the Unix command:
  1415. X>               ONAME=con ps -ef|sz -ay -
  1416. X>     will send a "file" to the PC-DOS console display.  The -y
  1417. X>     option instructs the receiver to open the file for writing
  1418. X>     unconditionally.    The -a option causes the receiver to con-
  1419. X>     vert Unix newlines to PC-DOS carriage returns and linefeeds.
  1420. X>
  1421. X
  1422. X     The second form is invoked as sb to batch send one or more
  1423. X     files with ZMODEM or YMODEM protocol.  The initial ZMODEM
  1424. X     initialization is not sent.  When requested by the receiver,
  1425. X     sb supports YMODEM-g with "cbreak" tty mode, XON/XOFF flow
  1426. X
  1427. X
  1428. X
  1429. XPrinted 10/25/87          OMEN                1
  1430. X
  1431. X
  1432. X
  1433. X
  1434. X
  1435. X
  1436. XSZ(1)               UNIX Programmer's Manual                SZ(1)
  1437. X
  1438. X
  1439. X
  1440. X     control, and interrupt character set to CAN (^X).  YMODEM-g
  1441. X     (Professional-YAM g option) increases throughput over error
  1442. X     free channels (direct connection, X.PC, etc.) by not ack-
  1443. X     nowledging each transmitted sector.
  1444. X
  1445. X     On Unix systems, additional information about the file is
  1446. X     transmitted.  If the receiving program uses this informa-
  1447. X     tion, the transmitted file length controls the exact number
  1448. X     of bytes written to the output dataset, and the modify time
  1449. X     and file mode are set accordingly.
  1450. X
  1451. X
  1452. X     The third form of sz is invoked as sx to send a single file
  1453. X     with XMODEM or XMODEM-1k protocol (sometimes incorrectly
  1454. X     called "ymodem").  The user must supply the file name to
  1455. X     both sending and receiving programs.
  1456. X
  1457. X>Not implemented in amiga version
  1458. X>     Iff sz is invoked with $SHELL set and iff that variable con-
  1459. X>     tains the string rsh or rksh (restricted shell), sz operates
  1460. X>     in restricted mode.  Restricted mode restricts pathnames to
  1461. X>     the current directory and PUBDIR (usually
  1462. X>     /usr/spool/uucppublic) and/or subdirectories thereof.
  1463. X
  1464. X
  1465. X     The fourth form sends a single COMMAND to a ZMODEM receiver
  1466. X     for execution.  Sz exits with the COMMAND return value.  If
  1467. X     COMMAND includes spaces or characters special to the shell,
  1468. X     it must be quoted.
  1469. X
  1470. X
  1471. X     The fifth form sends a single COMMAND to a ZMODEM receiver
  1472. X     for execution.  Sz exits as soon as the receiver has
  1473. X     correctly received the command, before it is executed.
  1474. X
  1475. X
  1476. X     If sz is invoked with stdout and stderr to different
  1477. X     datasets, Verbose is set to 2, causing frame by frame pro-
  1478. X     gress reports to stderr.  This may be disabled with the q
  1479. X     option.
  1480. X
  1481. X     The meanings of the available options are:
  1482. X
  1483. X     +      Instruct the receiver to append transmitted data to an
  1484. X      existing file (ZMODEM only).
  1485. X
  1486. XNot implemented in Amiga version
  1487. X>     1    Use file descriptor 1 for ioctls and reads.    By
  1488. X>       default, file descriptor 0 is used.    This option allows
  1489. X>       sz to be used with the Professional-YAM $ command.
  1490. X
  1491. X     a      Convert NL characters in the transmitted file to CR/LF.
  1492. X      This is done by the sender for XMODEM and YMODEM, by
  1493. X      the receiver for ZMODEM.
  1494. X     b      (ZMODEM) Binary override: transfer file without any
  1495. X      translation.
  1496. X
  1497. X
  1498. X
  1499. XPrinted 10/25/87          OMEN                2
  1500. X
  1501. X
  1502. X
  1503. X
  1504. X
  1505. X
  1506. XSZ(1)               UNIX Programmer's Manual                SZ(1)
  1507. X
  1508. X
  1509. X
  1510. X     c COMMAND
  1511. X      Send COMMAND to the receiver for execution, return with
  1512. X      COMMAND's exit status.
  1513. X     d      Change all instances of "." to "/" in the transmitted
  1514. X      pathname.  Thus, C.omenB0000 (which is unacceptable to
  1515. X      MSDOS or CP/M) is transmitted as C/omenB0000.  If the
  1516. X      resultant filename has more than 8 characters in the
  1517. X      stem, a "." is inserted to allow a total of eleven.
  1518. X     e      Escape all control characters; normally XON, XOFF, DLE,
  1519. X      CR-@-CR, and Ctrl-X are escaped.
  1520. X     f      Send Full pathname.  Normally directory prefixes are
  1521. X      stripped from the transmitted filename.
  1522. X     i COMMAND
  1523. X      Send COMMAND to the receiver for execution, return
  1524. X      Immediately upon the receiving program's successful
  1525. X      recption of the command.
  1526. X     k      (XMODEM/YMODEM) Send files using 1024 byte blocks
  1527. X      rather than the default 128 byte blocks.  1024 byte
  1528. X      packets speed file transfers at high bit rates.  (ZMO-
  1529. X      DEM streams the data for the best possible throughput.)
  1530. X     L N  Use ZMODEM sub-packets of length N.  A larger N (32 <=
  1531. X      N <= 1024) gives slightly higher throughput, a smaller
  1532. X      N speeds error recovery.  The default is 128 below 300
  1533. X      baud, 256 above 300 baud, or 1024 above 2400 baud.
  1534. X     l N  Wait for the receiver to acknowledge correct data every
  1535. X      N (32 <= N <= 1024) characters.  This may be used to
  1536. X      avoid network overrun when XOFF flow control is lack-
  1537. X      ing.
  1538. X     n      (ZMODEM) Send each file if destination file does not
  1539. X      exist.  Overwrite destination file if source file is
  1540. X      newer than the destination file.
  1541. X     N      (ZMODEM) Send each file if destination file does not
  1542. X      exist.  Overwrite destination file if source file is
  1543. X      newer or longer than the destination file.
  1544. X     o      (ZMODEM) Disable automatic selection of 32 bit CRC.
  1545. X     p      (ZMODEM) Protect existing destination files by skipping
  1546. X      transfer if the destination file exists.
  1547. X     q      Quiet suppresses verbosity.
  1548. X     r      (ZMODEM) Resume interrupted file transfer.  If the
  1549. X      source file is longer than the destination file, the
  1550. X      transfer commences at the offset in the source file
  1551. X      that equals the length of the destination file.
  1552. X     t tim
  1553. X      Change timeout to tim tenths of seconds.
  1554. X     u      Unlink the file after successful transmission.
  1555. X     v      Verbose causes a list of file names to be appended to
  1556. X      /tmp/szlog .    More v's generate more output.
  1557. X     y      Instruct a ZMODEM receiving program to overwrite any
  1558. X      existing file with the same name.
  1559. X     Y      Instruct a ZMODEM receiving program to overwrite any
  1560. X      existing file with the same name, and to skip any
  1561. X      source files that do have a file with the same pathname
  1562. X
  1563. X
  1564. X
  1565. XPrinted 10/25/87          OMEN                3
  1566. X
  1567. X
  1568. X
  1569. X
  1570. X
  1571. X
  1572. XSZ(1)               UNIX Programmer's Manual                SZ(1)
  1573. X
  1574. X
  1575. X
  1576. X      on the destination system.
  1577. X
  1578. XEXAMPLES
  1579. X     ZMODEM File Transfer
  1580. X     $ sz -a *.c
  1581. X     This single command transfers all .c files in the current
  1582. X     Unix directory with conversion (-a) to end of line conven-
  1583. X     tions appropriate to the receiving environment.  With ZMODEM
  1584. X     AutoDownload enabled, Professional-YAM  and ZCOMM will
  1585. X     automatically recieve the files after performing a security
  1586. X     check.
  1587. X
  1588. X     $ sz -Yan *.c *.h
  1589. X     Send only the .c and .h files that exist on both systems,
  1590. X     and are newer on the sending system than the corresponding
  1591. X     version on the receiving system, converting Unix to DOS text
  1592. X     format.
  1593. X
  1594. X     ZMODEM Command Download
  1595. X      cpszall:all
  1596. X     sz -c "c:;cd /yam/dist"
  1597. X     sz -ya $(YD)/*.me
  1598. X     sz -yqb y*.exe
  1599. X     sz -c "cd /yam"
  1600. X     sz -i "!insms"
  1601. X     This Makefile fragment uses sz to issue commands to
  1602. X     Professional-YAM to change current disk and directory.
  1603. X     Next, sz transfers the .me files from the $YD directory,
  1604. X     commanding the receiver to overwrite the old files and to
  1605. X     convert from Unix end of line conventions to PC-DOS conven-
  1606. X     tions.  The third line transfers some .exe files.    The
  1607. X     fourth and fifth lines command Pro-YAM to change directory
  1608. X     and execute a PC-DOS batch file insms . Since the batch file
  1609. X     takes considerable time, the -i form is used to allow sz to
  1610. X     exit immediately.
  1611. X
  1612. X     XMODEM File Transfer (To Crosstalk)
  1613. X     $ sx -a foo.c
  1614. X     ESC
  1615. X     rx foo.c
  1616. X     The above three commands transfer a single file from Unix to
  1617. X     a PC and Crosstalk with sz translating Unix newlines to DOS
  1618. X     CR/LF.  This combination is much slower than ZMODEM.
  1619. X
  1620. XSEE ALSO
  1621. X     rz(omen), ZMODEM.DOC, YMODEM.DOC, Professional-YAM,
  1622. X     IMP(CP/M), sq(omen), todos(omen), tocpm(omen), tomac(omen),
  1623. X     yam(omen)
  1624. X
  1625. X     Compile time options required for various operating systems
  1626. X     are described in the source file.
  1627. X
  1628. X
  1629. X
  1630. X
  1631. XPrinted 10/25/87          OMEN                4
  1632. X
  1633. X
  1634. X
  1635. X
  1636. X
  1637. X
  1638. XSZ(1)               UNIX Programmer's Manual                SZ(1)
  1639. X
  1640. X
  1641. X
  1642. XVMS VERSION
  1643. X     The VMS version does not transmit the file date.  The VMS
  1644. X     version calculates the file length by reading the file and
  1645. X     counting the bytes.
  1646. X
  1647. X     The VMS version does not support YMODEM-g or ZMODEM.
  1648. X
  1649. X     When VMS is lightly loaded, the response time may be too
  1650. X     quick for MODEM7 unless the MODEM7 q modifier is used.
  1651. X
  1652. X     The VMS C standard i/o package and RMS sometimes interact to
  1653. X     modify file contents unexpectedly.
  1654. X
  1655. XFILES
  1656. X     32 bit CRC code courtesy Gary S. Brown.
  1657. X
  1658. X     sz.c, rbsb.c, zm.c, zmodem.h source files
  1659. X
  1660. X     /tmp/szlog stores debugging output (sz -vv)
  1661. X
  1662. X>Not implemented in amiga version
  1663. X>TESTING FEATURE
  1664. X>     The command "sz -T file" exercises the Attn sequence error
  1665. X>     recovery by commanding errors with unterminated packets.
  1666. X>     The receiving program should complain five times about
  1667. X>     binary data packets being too long.  Each time sz is inter-
  1668. X>     rupted, it should send a ZDATA header followed by another
  1669. X>     defective packet.  If the receiver does not detect five long
  1670. X>     data packets, the Attn sequence is not interrupting the
  1671. X>     sender, and the Myattn string in sz.c must be modified.
  1672. X>
  1673. X>     After 5 packets, sz stops the "transfer" and prints the
  1674. X>     total number of characters "sent" (Tcount).  The difference
  1675. X>     between Tcount and 5120 represents the number of characters
  1676. X>     stored in various buffers when the Attn sequence is gen-
  1677. X>     erated.
  1678. X>
  1679. XBUGS
  1680. X     Calling sz from most versions of cu(1) doesn't work because
  1681. X     cu's receive process fights sz for characters from the
  1682. X     modem.
  1683. X
  1684. X     Many programs claiming to support YMODEM only support XMODEM
  1685. X     with 1k blocks, and they often don't get that quite right.
  1686. X
  1687. X     XMODEM transfers add up to 127 garbage bytes per file (1023
  1688. X     bytes with XMODEM-k).
  1689. X
  1690. X     YMODEM programs use the file length transmitted at the
  1691. X     beginning of the transfer to prune the file to the correct
  1692. X     length; this may cause problems with source files that grow
  1693. X     during the course of the transfer.  This problem does not
  1694. X     pertain to ZMODEM transfers, which preserve the exact file
  1695. X
  1696. X
  1697. X
  1698. XPrinted 10/25/87          OMEN                5
  1699. X
  1700. X
  1701. X
  1702. X
  1703. X
  1704. X
  1705. XSZ(1)               UNIX Programmer's Manual                SZ(1)
  1706. X
  1707. X
  1708. X
  1709. X     length unconditionally.
  1710. X
  1711. X     Most ZMODEM options are merely passed to the receiving pro-
  1712. X     gram; some do not implement all these options.
  1713. X
  1714. X     Circular buffering and a ZMODEM sliding window should be
  1715. X     used when input is from pipes instead of acknowledging
  1716. X     frames each 1024 bytes.  If no files can be opened, sz sends
  1717. X     a ZMODEM command to echo a suitable complaint; perhaps it
  1718. X     should check for the presence of at least one accessible
  1719. X     file before getting hot and bothered.  The test mode leaves
  1720. X     a zero length file on the receiving system.
  1721. X
  1722. X     Some high speed modems have a firmware bug that drops char-
  1723. X     acters when the direction of high speed transmissson is
  1724. X     reversed.    The environment variable ZNULLS may be used to
  1725. X     specify the number of nulls to send before a ZDATA frame.
  1726. X     Values of 101 for a 4.77 mHz PC and 124 for an AT are typi-
  1727. X     cal.
  1728. X
  1729. X
  1730. X
  1731. X
  1732. X
  1733. X
  1734. X
  1735. X
  1736. X
  1737. X
  1738. X
  1739. X
  1740. X
  1741. X
  1742. X
  1743. X
  1744. X
  1745. X
  1746. X
  1747. X
  1748. X
  1749. X
  1750. X
  1751. X
  1752. X
  1753. X
  1754. X
  1755. X
  1756. X
  1757. X
  1758. X
  1759. X
  1760. X
  1761. X
  1762. X
  1763. X
  1764. XPrinted 10/25/87          OMEN                6
  1765. X
  1766. X
  1767. X
  1768. SHAR_EOF
  1769. echo "extracting Zmodem/rz.doc"
  1770. sed 's/^X//' << \SHAR_EOF > Zmodem/rz.doc
  1771. X
  1772. X
  1773. X
  1774. XRZ(1)               UNIX Programmer's Manual                RZ(1)
  1775. X
  1776. X
  1777. X
  1778. XNAME
  1779. X     rx, rb, rz - XMODEM, YMODEM, ZMODEM (Batch) file receive
  1780. X
  1781. XSYNOPSIS
  1782. X     rz [- +1abepqtuv]
  1783. X     rb [- +1abqtuv]
  1784. X     rz [- 1abceqtuv] file
  1785. X     gz file ...
  1786. X>Not implemented in amiga version
  1787. X>     [-][v]rzCOMMAND
  1788. X
  1789. XDESCRIPTION
  1790. X     This program uses error correcting protocol to receive files
  1791. X     over a serial port from a variety of programs running under
  1792. X     AmigaDos,PC-DOS, CP/M, Unix, and other operating systems.
  1793. X
  1794. X     The first form of rz (Receive ZMODEM) receives files with
  1795. X     the ZMODEM batch protocol.  If the sending program does not
  1796. X     support ZMODEM, rz steps down to YMODEM protocol after 50
  1797. X     seconds.  This delay can be eliminated by invoking the pro-
  1798. X     gram as rb .
  1799. X
  1800. X     When receiving with XMODEM or YMODEM, Rz accepts either
  1801. X     standard 128 byte sectors or 1024 byte sectors (YAM -k
  1802. X     option).  The user should determine when the longer block
  1803. X     length actually improves throughput without causing prob-
  1804. X     lems.
  1805. X
  1806. X     If extended file information (file length, etc.) is
  1807. X     received, the file length controls the number of bytes writ-
  1808. X     ten to the output dataset (YMODEM only), and the modify time
  1809. X     and file mode (iff non zero) are set accordingly.
  1810. X
  1811. X     If no extended file information is received, slashes in the
  1812. X     pathname are changed to underscore, and any trailing period
  1813. X     in the pathname is eliminated.  This conversion is useful
  1814. X     for files received from CP/M systems.  With YMODEM, each
  1815. X     file name is converted to lower case unless it contains one
  1816. X     or more lower case letters.
  1817. X
  1818. X
  1819. X     The second form of rz receives a single file with XMODEM
  1820. X     protocol.    The user must supply the file name to both send-
  1821. X     ing and receiving programs.
  1822. X
  1823. X
  1824. X     Gz is a shell script which calls sz to command Pro-YAM or
  1825. X     ZCOMM to transmit the specified files.  Pathnames used with
  1826. X     gz must be escaped if they have special significance to the
  1827. X     Unix shell.
  1828. X     EXAMPLE: gz "-a C:*.c D:*.h"
  1829. X
  1830. X>Not implemented in amiga version
  1831. X>     The third form of rz is invoked as rzCOMMAND (with an
  1832. X
  1833. X
  1834. X
  1835. XPrinted 10/25/87          OMEN                1
  1836. X
  1837. X
  1838. X
  1839. X
  1840. X
  1841. X
  1842. XRZ(1)               UNIX Programmer's Manual                RZ(1)
  1843. X
  1844. X
  1845. X
  1846. X>     optional leading - as generated by login(1)).  For each
  1847. X>     received file, rz will pipe the file to ``COMMAND filename''
  1848. X>     where filename is the name of the transmitted file with the
  1849. X>     file contents as standard input.
  1850. X>
  1851. X>     Each file transfer is acknowledged when COMMAND exits with 0
  1852. X>     status.  A non zero exit status terminates transfers.
  1853. X>
  1854. X>     A typical use for this form is rzrmail which calls rmail(1)
  1855. X>     to post mail to the user specified by the transmitted file
  1856. X>     name.  For example, sending the file "caf" from a PC-DOS
  1857. X>     system to rzrmail on a Unix system would result in the con-
  1858. X>     tents of the DOS file "caf" being mailed to user "caf".
  1859. X>
  1860. X>     On some Unix systems, the login directory must contain a
  1861. X>     link to COMMAND as login sets SHELL=rsh which disallows
  1862. X>     absolute pathnames.  If invoked with a leading ``v'', rz
  1863. X>     will report progress to /tmp/rzlog.  The following entry
  1864. X>     works for Unix 3.0:
  1865. X>         rzrmail::5:1::/bin:/usr/local/rzrmail
  1866. X>     If the SHELL environment variable includes rsh or rksh (res-
  1867. X>     tricted shell), rz will not accept absolute pathnames or
  1868. X>     references to a parent directory, will not modify an exist-
  1869. X>     ing file, and removes any files received in error.
  1870. X>
  1871. X>     If rz is invoked with stdout and stderr to different
  1872. X>     datasets, Verbose is set to 2, causing frame by frame pro-
  1873. X>     gress reports to stderr.    This may be disabled with the q
  1874. X>     option.
  1875. X>
  1876. X>
  1877. X      The meanings of the available options are:
  1878. X
  1879. X>Not implemented in amiga version
  1880. X>
  1881. X>     1    Use file descriptor 1 for ioctls and reads (Unix only).
  1882. X>       By default, file descriptor 0 is used for ioctls and
  1883. X>       reads.  This option allows rz to be used with the
  1884. X>       Professional-YAM $ command and some versions of ncu(1).
  1885. X     a      Convert files to Unix conventions by stripping carriage
  1886. X      returns and all characters beginning with the first
  1887. X      Control Z (CP/M end of file).
  1888. X     b      Binary (tell it like it is) file transfer override.
  1889. X     c      Request 16 bit CRC.  XMODEM file transfers default to 8
  1890. X      bit checksum.  YMODEM and ZMODEM normally use 16 bit
  1891. X      CRC.
  1892. X     D      Output file data to /dev/null; for testing.
  1893. X     e      Force sender to escape all control characters; normally
  1894. X      XON, XOFF, DLE, CR-@-CR, and Ctrl-X are escaped.
  1895. X     p      (ZMODEM) Protect: skip file if destination file exists.
  1896. X     q      Quiet suppresses verbosity.
  1897. X     t tim
  1898. X      Change timeout to tim tenths of seconds.
  1899. X     v      Verbose causes a list of file names to be appended to
  1900. X
  1901. X
  1902. X
  1903. XPrinted 10/25/87          OMEN                2
  1904. X
  1905. X
  1906. X
  1907. X
  1908. X
  1909. X
  1910. XRZ(1)               UNIX Programmer's Manual                RZ(1)
  1911. X
  1912. X
  1913. X
  1914. X      /tmp/rzlog .    More v's generate more output.
  1915. X
  1916. XEXAMPLES
  1917. X     (Pro-YAM command)
  1918. X     <ALT-2>
  1919. X     Pro-YAM Command: sz *.h *.c
  1920. X     (This automatically invokes rz on the connected system.)
  1921. X
  1922. XSEE ALSO
  1923. X     ZMODEM.DOC, YMODEM.DOC, IMP(CP/M), Professional-YAM,
  1924. X     sz(omen), usq(omen), undos(omen)
  1925. X
  1926. X     Compile time options required for various operating systems
  1927. X     are described in the source file.
  1928. X
  1929. XNOTES
  1930. X     The Unix "ulimit" parameter must be set high enough to per-
  1931. X     mit large file transfers.
  1932. X
  1933. X     The TTY input buffering on some systems may not allow long
  1934. X     blocks or streaming input at high speed.  You should suspect
  1935. X     this problem when you can't send data to the Unix system at
  1936. X     high speeds using ZMODEM when YMODEM with 128 byte blocks
  1937. X     works properly.  If the system's tty line handling is really
  1938. X     broken, the serial port or the entire system may not survive
  1939. X     the onslaught of long bursts of high speed data.
  1940. X
  1941. X     The DSZ or Pro-YAM zmodem l numeric parameter may be set to
  1942. X     a value between 64 and 1024 to limit the burst length ("zmo-
  1943. X     dem pl128").
  1944. X
  1945. X     32 bit CRC code courtesy Gary S. Brown.
  1946. X
  1947. XBUGS
  1948. X     Calling rz from most versions of cu(1) doesn't work because
  1949. X     cu's receive process fights rz for characters from the
  1950. X     modem.
  1951. X
  1952. X     Pathnames are restricted to 127 characters.  In XMODEM sin-
  1953. X     gle file mode, the pathname given on the command line is
  1954. X     still processed as described above.  The ASCII option's
  1955. X     CR/LF to NL translation merely deletes CR's; undos(omen)
  1956. X     performs a more intelligent translation.
  1957. X
  1958. XVMS VERSION
  1959. X     Some of the #includes with file names enclosed with angle
  1960. X     brackets <> may need to have the angle brackets changed to
  1961. X     "", or vice versa.
  1962. X
  1963. X     The VMS version does not set binary mode according to the
  1964. X     incoming file type.  Non binary file processing consists of
  1965. X     stripping all characters beginning with CPMEOF (^Z).
  1966. X
  1967. X
  1968. X
  1969. XPrinted 10/25/87          OMEN                3
  1970. X
  1971. X
  1972. X
  1973. X
  1974. X
  1975. X
  1976. XRZ(1)               UNIX Programmer's Manual                RZ(1)
  1977. X
  1978. X
  1979. X
  1980. X     The VMS version does not set the file time.
  1981. X
  1982. X     At high speeds, VMS sometimes loses incoming characters,
  1983. X     resulting in retries and degradation of throughput.
  1984. X
  1985. X     The mysterious VMS C Standard I/O Package and RMS may
  1986. X     interact to modify file contents unexpectedly.
  1987. X
  1988. X     The VMS version does not support invocation as rzCOMMAND .
  1989. X     ZMODEM has not yet been implemented on the VMS version.
  1990. X
  1991. XZMODEM CAPABILITIES
  1992. X     Rz supports incoming ZMODEM binary (-b), ASCII (-a), protect
  1993. X     (-p), and append (-+) requests, and ZMODEM command execu-
  1994. X     tion.
  1995. X
  1996. XFILES
  1997. X     rz.c, rbsb.c, zm.c, zmodem.h source files.
  1998. X
  1999. X     /tmp/rzlog stores debugging output generated with -vv
  2000. X     option.
  2001. X
  2002. X
  2003. X
  2004. X
  2005. X
  2006. X
  2007. X
  2008. X
  2009. X
  2010. X
  2011. X
  2012. X
  2013. X
  2014. X
  2015. X
  2016. X
  2017. X
  2018. X
  2019. X
  2020. X
  2021. X
  2022. X
  2023. X
  2024. X
  2025. X
  2026. X
  2027. X
  2028. X
  2029. X
  2030. X
  2031. X
  2032. X
  2033. X
  2034. X
  2035. XPrinted 10/25/87          OMEN                4
  2036. X
  2037. X
  2038. X
  2039. SHAR_EOF
  2040. echo "extracting Zmodem/makefile.ami"
  2041. sed 's/^X//' << \SHAR_EOF > Zmodem/makefile.ami
  2042. X
  2043. XCC     = cc
  2044. XCFLAGS = +L -DAMIGA
  2045. X
  2046. Xzmodem: sz rz
  2047. X
  2048. Xsz: sz.o SerIO.o term.o
  2049. X    ln sz.o SerIO.o term.o -lc32
  2050. X
  2051. Xrz: rz.o SerIO.o term.o
  2052. X    ln rz.o SerIO.o term.o -lc32
  2053. X
  2054. Xsz.o: sz.c rbsb.c zm.c zmodem.h
  2055. X    $(CC) $(CFLAGS) sz.c
  2056. X
  2057. Xrz.o: rz.c rbsb.c zm.c zmodem.h
  2058. X    $(CC) $(CFLAGS) rz.c
  2059. X
  2060. XSerIO.o: SerIO.c
  2061. X    $(CC) $(CFLAGS) SerIO.c
  2062. X
  2063. Xterm.o: term.c
  2064. X    $(CC) $(CFLAGS) term.c
  2065. X
  2066. SHAR_EOF
  2067. echo "extracting Zmodem/makefile.uni"
  2068. sed 's/^X//' << \SHAR_EOF > Zmodem/makefile.uni
  2069. X# Makefile for Unix/Xenix rz and sz programs
  2070. X# the makefile is not too well tested yet
  2071. X
  2072. Xnothing:
  2073. X    @echo
  2074. X    @echo "Please study the #ifdef's in rbsb.c, rz.c and sz.c,"
  2075. X    @echo "then type 'make system' where system is one of:"
  2076. X    @echo "    sysv    SYSTEM 5 Unix"
  2077. X    @echo "    xenix    SYSTEM 3/5 Xenix"
  2078. X    @echo "    x386    386 Xenix"
  2079. X    @echo "    bsd    Berkeley 4.x BSD, and Ultrix"
  2080. X    @echo
  2081. X
  2082. Xusenet:
  2083. X    shar -f /tmp/rzsz README Makefile zmodem.h zm.c sz.c rz.c rbsb.c \
  2084. X      minirb.c *.1 gz ptest.sh zupl.t
  2085. X
  2086. Xshar:
  2087. X     shar -f /tmp/rzsz1et2 -m 1000000 README Makefile zmodem.h zm.c \
  2088. X        sz.c rz.c rbsb.c minirb.c *.1 gz ptest.sh zupl.t
  2089. X
  2090. Xarc:
  2091. X    rm -f /tmp/rzsz.arc
  2092. X    arc a /tmp/rzsz README Makefile zmodem.h zm.c sz.c rz.c \
  2093. X        rbsb.c *.1 gz ptest.sh zupl.t minirb.c
  2094. X    chmod og-w /tmp/rzsz.arc
  2095. X    ln /tmp/rzsz.arc /usr/spool/uucppublic
  2096. X    mv /tmp/rzsz.arc /t/yam
  2097. X
  2098. Xzoo:
  2099. X    rm -f /tmp/rzsz.zoo
  2100. X    zoo a /tmp/rzsz README Makefile zmodem.h zm.c sz.c rz.c \
  2101. X        rbsb.c *.1 gz ptest.sh zupl.t minirb.c
  2102. X    chmod og-w /tmp/rzsz.zoo
  2103. X    ln /tmp/rzsz.zoo /usr/spool/uucppublic
  2104. X    mv /tmp/rzsz.zoo /t/yam
  2105. X
  2106. X.PRECIOUS:rz sz
  2107. X
  2108. Xxenix:
  2109. X    cc -M0 -Ox -K -i -DNFGVMIN -DREADCHECK sz.c -lx -o sz
  2110. X    size sz
  2111. X    -ln sz sb
  2112. X    -ln sz sx
  2113. X    cc -M0 -Ox -K -i rz.c -o rz
  2114. X    size rz
  2115. X    -ln rz rb
  2116. X    -ln rz rx
  2117. X
  2118. Xx386:
  2119. X    cc -Ox rz.c -o rz
  2120. X    size rz
  2121. X    -ln rz rb
  2122. X    -ln rz rx
  2123. X    cc -Ox -DNFGVMIN -DREADCHECK sz.c -lx -o sz
  2124. X    size sz
  2125. X    -ln sz sb
  2126. X    -ln sz sx
  2127. X
  2128. Xsysv:
  2129. X    cc -O rz.c -o rz
  2130. X    size rz
  2131. X    -ln rz rb
  2132. X    -ln rz rx
  2133. X    cc -DSVR2 -O -DNFGVMIN sz.c -o sz
  2134. X    size sz
  2135. X    -ln sz sb
  2136. X    -ln sz sx
  2137. X
  2138. Xbsd:
  2139. X    cc -DV7 -O rz.c -o rz
  2140. X    size rz
  2141. X    -ln rz rb
  2142. X    -ln rz rx
  2143. X    cc -DV7 -O -DNFGVMIN sz.c -o sz
  2144. X    size sz
  2145. X    -ln sz sb
  2146. X    -ln sz sx
  2147. X
  2148. Xsz: nothing
  2149. Xsb: nothing
  2150. Xrz: nothing
  2151. Xrb: nothing
  2152. SHAR_EOF
  2153. echo "extracting Zmodem/zmodem.init"
  2154. sed 's/^X//' << \SHAR_EOF > Zmodem/zmodem.init
  2155. X2400 8N1 -7
  2156. SHAR_EOF
  2157. echo "extracting Zmodem/zmodem.h"
  2158. sed 's/^X//' << \SHAR_EOF > Zmodem/zmodem.h
  2159. X/*
  2160. X *   Z M O D E M . H     Manifest constants for ZMODEM
  2161. X *    application to application file transfer protocol
  2162. X *    05-23-87  Chuck Forsberg Omen Technology Inc
  2163. X */
  2164. X#define ZPAD '*'        /* 052 Padding character begins frames */
  2165. X#define ZDLE 030        /* Ctrl-X Zmodem escape - `ala BISYNC DLE */
  2166. X#define ZDLEE (ZDLE^0100)       /* Escaped ZDLE as transmitted */
  2167. X#define ZBIN 'A'        /* Binary frame indicator */
  2168. X#define ZHEX 'B'        /* HEX frame indicator */
  2169. X#define ZBIN32 'C'      /* Binary frame with 32 bit FCS */
  2170. X
  2171. X/* Frame types (see array "frametypes" in zm.c) */
  2172. X#define ZRQINIT 0       /* Request receive init */
  2173. X#define ZRINIT  1       /* Receive init */
  2174. X#define ZSINIT 2        /* Send init sequence (optional) */
  2175. X#define ZACK 3          /* ACK to above */
  2176. X#define ZFILE 4         /* File name from sender */
  2177. X#define ZSKIP 5         /* To sender: skip this file */
  2178. X#define ZNAK 6          /* Last packet was garbled */
  2179. X#define ZABORT 7        /* Abort batch transfers */
  2180. X#define ZFIN 8          /* Finish session */
  2181. X#define ZRPOS 9         /* Resume data trans at this position */
  2182. X#define ZDATA 10        /* Data packet(s) follow */
  2183. X#define ZEOF 11         /* End of file */
  2184. X#define ZFERR 12        /* Fatal Read or Write error Detected */
  2185. X#define ZCRC 13         /* Request for file CRC and response */
  2186. X#define ZCHALLENGE 14   /* Receiver's Challenge */
  2187. X#define ZCOMPL 15       /* Request is complete */
  2188. X#define ZCAN 16         /* Other end canned session with CAN*5 */
  2189. X#define ZFREECNT 17     /* Request for free bytes on filesystem */
  2190. X#define ZCOMMAND 18     /* Command from sending program */
  2191. X#define ZSTDERR 19      /* Output to standard error, data follows */
  2192. X
  2193. X/* ZDLE sequences */
  2194. X#define ZCRCE 'h'       /* CRC next, frame ends, header packet follows */
  2195. X#define ZCRCG 'i'       /* CRC next, frame continues nonstop */
  2196. X#define ZCRCQ 'j'       /* CRC next, frame continues, ZACK expected */
  2197. X#define ZCRCW 'k'       /* CRC next, ZACK expected, end of frame */
  2198. X#define ZRUB0 'l'       /* Translate to rubout 0177 */
  2199. X#define ZRUB1 'm'       /* Translate to rubout 0377 */
  2200. X
  2201. X/* zdlread return values (internal) */
  2202. X/* -1 is general error, -2 is timeout */
  2203. X#define GOTOR 0400
  2204. X#define GOTCRCE (ZCRCE|GOTOR)   /* ZDLE-ZCRCE received */
  2205. X#define GOTCRCG (ZCRCG|GOTOR)   /* ZDLE-ZCRCG received */
  2206. X#define GOTCRCQ (ZCRCQ|GOTOR)   /* ZDLE-ZCRCQ received */
  2207. X#define GOTCRCW (ZCRCW|GOTOR)   /* ZDLE-ZCRCW received */
  2208. X#define GOTCAN  (GOTOR|030)     /* CAN*5 seen */
  2209. X
  2210. X/* Byte positions within header array */
  2211. X#define ZF0     3       /* First flags byte */
  2212. X#define ZF1     2
  2213. X#define ZF2     1
  2214. X#define ZF3     0
  2215. X#define ZP0     0       /* Low order 8 bits of position */
  2216. X#define ZP1     1
  2217. X#define ZP2     2
  2218. X#define ZP3     3       /* High order 8 bits of file position */
  2219. X
  2220. X/* Bit Masks for ZRINIT flags byte ZF0 */
  2221. X#define CANFDX  01      /* Rx can send and receive true FDX */
  2222. X#define CANOVIO 02      /* Rx can receive data during disk I/O */
  2223. X#define CANBRK  04      /* Rx can send a break signal */
  2224. X#define CANCRY  010     /* Receiver can decrypt */
  2225. X#define CANLZW  020     /* Receiver can uncompress */
  2226. X#define CANFC32 040     /* Receiver can use 32 bit Frame Check */
  2227. X#define ESCCTL 0100     /* Receiver expects ctl chars to be escaped */
  2228. X#define ESC8   0200     /* Receiver expects 8th bit to be escaped */
  2229. X
  2230. X/* Parameters for ZSINIT frame */
  2231. X#define ZATTNLEN 32     /* Max length of attention string */
  2232. X/* Bit Masks for ZSINIT flags byte ZF0 */
  2233. X#define TESCCTL 0100    /* Transmitter expects ctl chars to be escaped */
  2234. X#define TESC8   0200    /* Transmitter expects 8th bit to be escaped */
  2235. X
  2236. X/* Parameters for ZFILE frame */
  2237. X/* Conversion options one of these in ZF0 */
  2238. X#define ZCBIN   1       /* Binary transfer - inhibit conversion */
  2239. X#define ZCNL    2       /* Convert NL to local end of line convention */
  2240. X#define ZCRESUM 3       /* Resume interrupted file transfer */
  2241. X/* Management include options, one of these ored in ZF1 */
  2242. X#define ZMSKNOLOC       0200    /* Skip file if not present at rx */
  2243. X/* Management options, one of these ored in ZF1 */
  2244. X#define ZMMASK  037     /* Mask for the choices below */
  2245. X#define ZMNEWL  1       /* Transfer if source newer or longer */
  2246. X#define ZMCRC   2       /* Transfer if different file CRC or length */
  2247. X#define ZMAPND  3       /* Append contents to existing file (if any) */
  2248. X#define ZMCLOB  4       /* Replace existing file */
  2249. X#define ZMNEW   5       /* Transfer if source newer */
  2250. X        /* Number 5 is alive ... */
  2251. X#define ZMDIFF  6       /* Transfer if dates or lengths different */
  2252. X#define ZMPROT  7       /* Protect destination file */
  2253. X/* Transport options, one of these in ZF2 */
  2254. X#define ZTLZW   1       /* Lempel-Ziv compression */
  2255. X#define ZTCRYPT 2       /* Encryption */
  2256. X#define ZTRLE   3       /* Run Length encoding */
  2257. X/* Extended options for ZF3, bit encoded */
  2258. X#define ZXSPARS 64      /* Encoding for sparse file operations */
  2259. X
  2260. X/* Parameters for ZCOMMAND frame ZF0 (otherwise 0) */
  2261. X#define ZCACK1  1       /* Acknowledge, then do command */
  2262. X
  2263. Xlong rclhdr();
  2264. X
  2265. X/* Globals used by ZMODEM functions */
  2266. Xextern Rxframeind;      /* ZBIN ZBIN32, or ZHEX type of frame received */
  2267. Xextern Rxtype;          /* Type of header received */
  2268. Xextern Rxcount;         /* Count of data bytes received */
  2269. Xextern Zrwindow;        /* RX window size (controls garbage count) */
  2270. Xextern Rxtimeout;       /* Tenths of seconds to wait for something */
  2271. Xextern char Rxhdr[4];   /* Received header */
  2272. Xextern char Txhdr[4];   /* Transmitted header */
  2273. Xextern long Rxpos;      /* Received file position */
  2274. Xextern long Txpos;      /* Transmitted file position */
  2275. Xextern Txfcs32;         /* TURE means send binary frames with 32 bit FCS */
  2276. Xextern Crc32t;          /* Display flag indicating 32 bit CRC being sent */
  2277. Xextern Crc32;           /* Display flag indicating 32 bit CRC being received */
  2278. Xextern Znulls;          /* Number of nulls to send at beginning of ZDATA hdr */
  2279. Xextern char Attn[ZATTNLEN+1];   /* Attention string rx sends to tx on err */
  2280. X
  2281. X/* End of ZMODEM.H */
  2282. SHAR_EOF
  2283. echo "End of archive 2 (of 9)"
  2284. # if you want to concatenate archives, remove anything after this line
  2285. exit
  2286.